现在的位置: 首页 > 综合 > 正文

mysql/oracle多字段去重方法

2018年04月14日 ⁄ 综合 ⁄ 共 318字 ⁄ 字号 评论关闭

1、Oracle-没尝试过

delete from table where rowid not in (selelct max(rowid) from table group by id,a);

2、mysql-创建临时表,不适合大数据量的表去重

create temporary table tmp_backup as select * from backup_file_item group by userid,module,mobilename,type having count(1) > 1;
truncate table backup_file_item;
insert into backup_file_item select * from tmp_backup;
drop table tmp_backup;

抱歉!评论已关闭.