假設存在一個主鍵ID,Name為重復列--下面這句可以查出所有的沒有重復的數(shù)據(jù)select * from 表 as a where ID=(select min(ID) from 表 where Name=a.Name) --根據(jù)上面這句就可以刪除所有重復項的數(shù)據(jù)delete from 表 where ID not in(select ID from 表 as a where ID=(select min(ID) from 表 where Name=a.Name))好了~
網(wǎng)站建設中經(jīng)常用到的
請謹記