读书人

请教两个值的嵌套查询如何做

发布时间: 2012-01-18 00:23:26 作者: rapoo

请问两个值的嵌套查询怎么做?
select * from table1 where
(aa,bb) in (select aa,bb from table1 where cc= 'dd ')
如上的一个查询,但是我写的不对,请帮我纠正一下

[解决办法]
select * from table1 a where exists(select 1 from table1 where aa=a.aa and bb=a.bb and cc = 'dd ')

读书人网 >SQL Server

热点推荐