mysql查看数据表是否有重复数据 - 子墨' - 博客园
mysql查看数据表是否有重复数据 - 子墨’ - 博客园
mysql查看数据表是否有重复数据
我们可以用 select * from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
select * from Users where UserId in (select UserId from Users group by UserId having count(UserId) > 1)
不过在数据量过大的时候查询的速度会非常慢
select count(peopleId) from people
select count(distinct peopleId) from people
我们可以用上面两条语句的结果进行对比判断是否存在重复数据
Measure
Measure

