标签:
参考 http://www.cnblogs.com/chy1000/archive/2010/03/02/1676282.html
DELETE FROM student WHERE sname IN (SELECT a.sname FROM (SELECT tmp.* FROM student tmp)a GROUP BY a.sname HAVING COUNT(a.sname) > 1) AND sno NOT IN (SELECT MIN(a.sno) FROM (SELECT tmp.* FROM student tmp)a GROUP BY a.sname HAVING COUNT(a.sname)>1)
标签:
原文地址:http://my.oschina.net/airship/blog/476586