删除重复数据的sql:DELETE FROM users where user_id not in (select user_id from (select DISTINCT * from users GROUP BY name) as b ) ;
查询出重复数据及重复次数:SELECT `name`, COUNT(`name`) count from users GROUP BY `name` HAVING COUNT(`name`) > 1
删除重复数据的sql:DELETE FROM users where user_id not in (select user_id from (select DISTINCT * from users GROUP BY name) as b ) ;
查询出重复数据及重复次数:SELECT `name`, COUNT(`name`) count from users GROUP BY `name` HAVING COUNT(`name`) > 1