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