假设D列为ID列是Pramary Key,SQL如下:
select * from table_name where D in(select mid from (select min(D) as mid from table_name group by A,B,C having count(*)>1) test );
查询后进行观察,无误后进行delete操作:
delete from table_name where D in(select mid from (select min(D) as mid from table_name group by A,B,C having count(*)>1) test );
参考资料:http://blog.csdn.net/carry9148/article/details/52252804
如果 abc重复 d 不重复怎么取数?
你这题有问题。