時間:2024-02-28 13:28作者:下載吧人氣:31
海量數據(百萬以上),其中有些全部字段都相同,有些部分字段相同,怎樣高效去除重復?
如果要刪除手機(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 )
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 )
網友評論