数据库两个关联的,不一样的表,找出两个表里面没有对应的数据:
select * from A a where a.id not in(selsect b.id from B b) //a表里面id 和b表里面id对应
数据库里面一张表里面查找重复的数据:
select * from A group by name having count (name)>1 //统计所有名字重复的数据
数据库两个关联的,不一样的表,找出两个表里面没有对应的数据:
select * from A a where a.id not in(selsect b.id from B b) //a表里面id 和b表里面id对应
数据库里面一张表里面查找重复的数据:
select * from A group by name having count (name)>1 //统计所有名字重复的数据