1、 delete from aa a1 where not exists( select * from aa a2 where a1.id>a2.id and a1.name=a2.name and a1.age=a2.age);
2、 delete from aa where id not in(Select min(id) from aa Group by name,age);
3、delete from aa where id in(Select a2.id from aa a1,aa a2 where a1.id>a2.id and a1.name=a2.name and a1.age=a2.age)
...全文
1844打赏收藏
删除表中重复的记录,是否三条语句都一样?
1、 delete from aa a1 where not exists( select * from aa a2 where a1.id>a2.id and a1.name=a2.name and a1.age=a2.age); 2、 delete from aa where id not in(Select min(id) from aa Group by name,age); 3、delete from aa where id in(Select a2.id from aa a1,aa