一个表中有重复记录如何用SQL语句查询出来?
一个表中有重复记录如何用SQL语句查询出来?
日期:2019-08-07 18:02:27 人气:1
select * from tablename where 重复字段1 in (select 重复字段1 from tablename group by 重复字段1,重复字段2 having count(*)>1)。
SQL重复记录查询方法:1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select * from peoplewhere peopleId in (select peopleId from people group by peopleId h