日期:2014-05-16  浏览次数:20664 次

in 与exists????
select article ,dealer,price 
from shop  
where article=0001 
or dealer IN (select dealer from shop where article=0001);

装换成exists??怎么结果不对,谁能帮弄下。
select article ,dealer,price 
from shop  
where 
article=0001 
or
 exists (select dealer from shop where 
shop.dealer=shop.dealer and
 article=0001 );


------解决方案--------------------
SQL code
SELECT article ,dealer,price  
FROM shop   
WHERE   
article=0001  
or
EXISTS(SELECT dealer FROM shop WHERE  article=0001 );