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 ……)……
...