34,593
社区成员
发帖
与我相关
我的任务
分享
select (name as n1 from t1 where ...), (name as n2 from t1 where ...)
select * from T1 a where exists(select 1 from t1 where ID=a.ID and Name='?') and exists
(select 1 from t1 where ID=a.ID and Name='??')--应有一个条件ID与外表连
----------------
if exists(select 1 from T1 where Name='?') and exists(select 1 from T1 where Name='??')
select * from T1
或:
select * from T1 a where exists(select 1 from t1 where Name='?') and exists
(select 1 from t1 where Name='??')