选出相同记录的SQL语句是:
select * from tableName where id in (
select id from tableName group by id having count(*) > 1)
删除相同记录的SQL语句是:
delete from tableName where id in (
select id from tableName group by id having count(*) > 1)
注意,这样所有相同的记录都删除了,一条也不剩下。
选出相同记录的SQL语句是:
select * from tableName where id in (
select id from tableName group by id having count(*) > 1)
删除相同记录的SQL语句是:
delete from tableName where id in (
select id from tableName group by id having count(*) > 1)
注意,这样所有相同的记录都删除了,一条也不剩下。