Oracle怎么删除重复数据

Oracle如何删除重复数据如题表结构如下员工标识社会关系姓名年龄1父子a221父子a221父子a222母女b232母女b2

Oracle如何删除重复数据
如题
表结构如下
员工标识 社会关系 姓名 年龄  
1 父子 a 22
1 父子 a 22
1 父子 a 22
2 母女 b 23
2 母女 b 23
3 父子 c 30
需要删除重复

1 父子 a 22
2 母女 b 23
3 父子 c 30


[解决办法]
delete from table1 t1 where exists (select 1 from table1 t2 where t1.id = t2.id and t1.rowid > t2.rowid ) ;

试试看.
[解决办法]
通过 rowid 来区分相同数据的记录行

SQL code
delete from table1 where rowid not in (select max(rowid) from table1 group by 所有字段)
[解决办法]
SQL code
delete from table1 where rowid not in (select max(rowid) from table1 group by 所有字段)
[解决办法]
2、3楼的正解,修改如下:
delete from 表名
 where rowid not in (select max(rowid) from 表名
 group by 员工标识,社会关系,姓名,年龄)
[解决办法]
探讨
通过 rowid 来区分相同数据的记录行

SQL code
delete from table1
where rowid not in (select max(rowid) from table1 group by 所有字段)

[解决办法]
delete from table1 a
where a.rowid<>(select max(rowid) from table1 b where a.主键=b.主键)

delete from table1
where rowid not in (select max(rowid) from table1 group by 所有字段)

学习了
[解决办法]
探讨
通过 rowid 来区分相同数据的记录行


SQL code
delete from table1
where rowid not in (select max(rowid) from table1 group by 所有字段)

[解决办法]
SQL code
delete from table1 where rowid not in (select max(rowid) from table1 group by 所有字段)
[解决办法]
探讨
SQL code

delete from table1
where rowid not in (select max(rowid) from table1 group by 所有字段)
正解

[解决办法]
rowid速度最优