如何把a表里在b表里没有的数据显示出来?
a表 uid name pass class
a里面数据,
1...
2...
3...
4...
5...
b表
uid tt
2 g
2 t
3 t
4 t
4 t
写一个查询,把b表里没有的1.5给取出来. 谢谢了
问题点数:20、回复次数:5Top
1 楼hszjx(留心剑)回复于 2005-09-06 08:24:25 得分 6
select * from a where uid not in (select uid from b)Top
2 楼spring_504(土人)回复于 2005-09-06 08:25:22 得分 5
select * from a where uid not in(select uid from b)Top
3 楼purexia(下风)回复于 2005-09-06 08:29:17 得分 2
select * from a where uid not in(select uid from b)Top
4 楼Yisa()回复于 2005-09-06 08:29:46 得分 5
Please try:
select * from a where not exists(select uid from b where b.uid=a.uid)
Top
5 楼fandy81(fandy)回复于 2005-09-06 08:30:35 得分 2
select * from a where uid not in(select uid from b)Top




