如何查询在A表中不存在的B表的数据(id+bm两个条件)
A 表
id bm
1 2
1 3
1 4
b表
id bm
1 2
1 3
1 4
1 5
1 6
如何查询在A表中不存在的B表的数据(id+bm两个条件)
如图的话就是
1 5
1 6
[解决办法]
select b.*from bwhere not exists(select 1 from a where a.id=b.id and a.bm=b.bm)
[解决办法]
select * from a where not exists(select 1 from tb where id=a.id and bm=a.bm)
[解决办法]
select * from b except select * from a
[解决办法]
select * from A where checksum(id, bm) not in (select checksum(id, bm)from B)
[解决办法]
select * from BWHERE NOT EXISTS (SELECT 1 FROM A WHERE id = B.id AND bm = B.bm)
[解决办法]
select * from a where checksum(*) not in(select checksum(*) from b)