Two query in one with SQL Server
This is what I'm trying to do something similar to the foll开发者_如何转开发owing request, but I don't know if it's possible with the SQL-Server syntax:
declare @idClient int
select @idClient=idClient from table
where entite is null and (SELECT * from table where entite=@idClient) is null
Thanks.
Maybe this?
SELECT t1.[idClient]
FROM [table] t1
WHERE [entite] IS NULL
AND NOT EXISTS (
SELECT NULL
FROM [table] t2
WHERE t2.[entite]=t1.[idClient]
)
精彩评论