开发者

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]
       )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜