两个表:
a
a1,a2,a3
b
a1,b2,b3
想找出a表中中不包含在b表的纪录
用
select * from a where a.a1 not in (select a1 from b)
怎么查不出结果啊!
a
a1,a2,a3
b
a1,b2,b3
想找出a表中中不包含在b表的纪录
用
select * from a where a.a1 not in (select a1 from b)
怎么查不出结果啊!
where b.b1=a.a1 and b.b2=a.a2 and b.b3=a.a3)
where not exists
(select 1 from t1 where a1=A.a1 )
对于列数不固定的尤其有用:select * from a where checksum(*) not in (select checksum(*) from b)