赞
踩
select * from table1 where v1 = X group by column1 having count(*)>1
1.先通过max或者min函数对不相关列进行操作
select max(column1) from table1 group by column2;
2.嵌套把重复数据全部信息查出进行操作
select * from where column in(select max(column1) from table1 group by column2);
3.以上信息查出的都是单独的一条非重复数据(有用数据),现在删除其他无用数据
delete from column2 not in(select * from where column in(select max(column1) from table1 group by column2))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。