错误:
delete from student where username in ( select username from student group by username having count(username)>1) and id not in (select min(id) as id from student group by username having count(username)>1 )
正确:
delete from student where username in (select username from ( select username from student group by username having count(username)>1) a) and id not in ( select id from (select min(id) as id from student group by username having count(username)>1 ) b)
本文来自博客园,作者:哈利波特甜,转载请注明原文链接:https://www.cnblogs.com/zmh-980509/p/12422140.html