sql语句 ## 删除重复的行

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/li740207611/article/details/84196196

sql语句

删除重复的行

 DELETE from t_holders a where (a.hid,a.company_id) in (select hid,company_id  from t_holders group by hid,company_id having count(*) > 1)
 and id not in (select min(id) from t_holders group by hid,company_id having count(*)>1)

猜你喜欢

转载自blog.csdn.net/li740207611/article/details/84196196