時間:2024-02-28 13:28作者:下載吧人氣:29
海量數(shù)據(jù)(百萬以上),其中有些全部字段都相同,有些部分字段相同,怎樣高效去除重復(fù)?
如果要刪除手機(mobilePhone),電話(officePhone),郵件(email)同時都相同的數(shù)據(jù),以前一直使用這條語句進行去重:
delete from 表 where id not in
(select max(id) from 表 group by mobilePhone,officePhone,email )
or
delete from 表 where id not in
(select min(id) from 表 group by mobilePhone,officePhone,email )
delete from 表 where id not in
(select max(id) from 表 group by mobilePhone,officePhone,email )
or
delete from 表 where id not in
(select min(id) from 表 group by mobilePhone,officePhone,email )
網(wǎng)友評論