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

在ACCESS中如何使用IN /NOT IN,如果没有,有没有变通的方法
selet   *   from   order   where   order_id   in(select   order_id   from   order_detail)


------解决方案--------------------
--这句没有问题,只不过效率不是很高
selet * from [order] where order_id in (select order_id from order_detail)


--可以用表连接
selet A.*
from [order] A inner join order_detail b on A.order_id=B.order_id
------解决方案--------------------
可以:
IN:
selet * from order where order_id in(select order_id from order_detail)
selet A.*
from [order] A inner join order_detail b on A.order_id=B.order_id
NOT IN:
selet * from order where order_id NOT in(select order_id from order_detail)
selet A.*
from [order] A LEFT join order_detail b on A.order_id=B.order_id WHERE ISNULL(B.order_id )