mysql查詢消除重復,mySQL刪除相同數據的SQL語句怎么寫?
如果是重復的內容只保留一條,可以試試 delete from t where id not in ( select id from t group by c1, c2, c3, c4)
如果所有重復的內容都刪掉可以試試 delete from t where id not in ( select id from t group by c1, c2, c3, c4 having count (*) < 2)
如果是重復的內容只保留一條,可以試試 delete from t where id not in ( select id from t group by c1, c2, c3, c4)
如果所有重復的內容都刪掉可以試試 delete from t where id not in ( select id from t group by c1, c2, c3, c4 having count (*) < 2)