在Oracle中如何利用Rowid查找和删除表中的重复记录(3) 5 3 dar 6 1 wee 7 2 zxc
20 rows selected.1.查找重复记录的几种方法:(1).SQL>select * from cz group by c1,c10,c20 having count(*) >1; C1 C10 C20---------- ---------- --- 1 2 dsf 2 3 che 3 4 dff(2).SQL>select distinct * from cz;
C1 C10 C20---------- ---------- --- 1 2 dsf 2 3 che 3 4 dff(3).SQL>select * from cz a where rowid=(select max(rowid) from cz where c1=a.c1 and c10=a.c10 and c20=a.c20); C1 C10 C20---------- ---------- --- 1 2 dsf 2 3 che