1. 程式人生 > >sql語句 ## 刪除重複的行

sql語句 ## 刪除重複的行

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)