标签:
delete table from table a, ( select b.val1 ,b.val2 ,COUNT(1) as cnt from table b group by b.val1 ,b.val2 haval1g COUNT(1) > 1 )b where a.val1 = b.val1 and a.val2 = b.val2 and a.id not in ( select MAX(id) as id from table a group by val1 ,val2 haval1g COUNT(1) > 1 )
标签:
原文地址:http://www.cnblogs.com/nonkicat/p/5960784.html