刪除重複的數據

delete user1 from t_user user1,(select t1.id from t_user t1,(select username,min(id) as minid from t_user group by username having count(username)>1) t2 where t1.username=t2.username and t1.id<>t2.minid) user2 where user1.id=user2.id 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章