日期:2014-05-19  浏览次数:20556 次

exists附近有错?
select   top   16   *   from   picUploadT   where   picType= 'baobaoXiu '   and   userid   in   (1,2,3)   order   by   picId   desc   这样是不要运行的

select   top   16   *   from   picUploadT   where   picType= 'baobaoXiu '   and   userid   exists   (1,2,3)   order   by   picId   desc   就提示错误。
请问:错在哪里?谢谢

------解决方案--------------------
declare @t table(id int)
insert into @t select 1 union select 2 union select 3 union select 4

select *
from @t
where id =any (select 1 union select 2)
/*

id
-----------
1
2

*/

嘿嘿
------解决方案--------------------
select top 16 * from picUploadT where picType= 'baobaoXiu ' and userid exists (1,2,3) order by picId desc


userid exists (1,2,3) 这里不对
exists 和 in不是一个概念