Oracle删除多字段重复数据,只保留一条记录

 

前提:表user_info,字段Id(主键),age,sex

 

删除除主键id外,age和sex字段重复的数据,只留有rowid最小的记录

delete from user_INFO a where (a.age,a.sex) in (select age,sex group by age,sex having count(*) > 1) and rowid not in (select min(rowid) from user_INFO group by age,sex having count(*)>1);

 

Oracle删除多字段重复数据,只保留一条记录

上一篇:excel数据导入mysql


下一篇:SuperMap Objects开发——下载安装地址、许可配置和控件加载