祁望
2016-05-09 14:14
delete a from tb1 a join (select name,count(*) from tb1 group by name having COUNT (*)>1) b on a.name=b.name where a.ID<b.ID;
给聚合函数count(*)取个别名就可以了, delete ……join (……count(*) as num from ……)……
...
MySQL开发技巧(二)
61864 学习 · 30 问题
相似问题