1、except
要求a,b两个表结构一致
select * from a
except
select * from b
2、not in
select id from a
where a.id not in (select id from b)
3、分组取最大值
select a,max(b) from c group by a
mysql 求差集
最新推荐文章于 2024-01-18 11:36:21 发布
1、except
要求a,b两个表结构一致
select * from a
except
select * from b
2、not in
select id from a
where a.id not in (select id from b)
3、分组取最大值
select a,max(b) from c group by a