SQL> select deptno,dname,loc,rowid from mydept order by deptno;
DEPTNO DNAME LOC ROWID
---------- -------------- ------------- ------------------
10 ACCOUNTING NEW YORK AAAM6GAAEAAAAG8AAA
11 ACCOUNTING NEW YORK AAAM6GAAEAAAAG9AAA
12 ACCOUNTING NEW YORK AAAM6GAAEAAAAG9AAB
13 ACCOUNTING NEW YORK AAAM6GAAEAAAAG9AAC
20 RESEARCH DALLAS AAAM6GAAEAAAAG8AAB
21 RESEARCH DALLAS AAAM6GAAEAAAAG9AAD
30 SALES CHICAGO AAAM6GAAEAAAAG8AAC
40 OPERATIONS BOSTON AAAM6GAAEAAAAG8AAD
DEPTNO DNAME LOC ROWID
---------- -------------- ------------- ------------------
10 ACCOUNTING NEW YORK AAAM6GAAEAAAAG8AAA
11 ACCOUNTING NEW YORK AAAM6GAAEAAAAG9AAA
12 ACCOUNTING NEW YORK AAAM6GAAEAAAAG9AAB
13 ACCOUNTING NEW YORK AAAM6GAAEAAAAG9AAC
20 RESEARCH DALLAS AAAM6GAAEAAAAG8AAB
21 RESEARCH DALLAS AAAM6GAAEAAAAG9AAD
30 SALES CHICAGO AAAM6GAAEAAAAG8AAC
40 OPERATIONS BOSTON AAAM6GAAEAAAAG8AAD
DELETE FROM mydept
WHERE ROWID NOT IN (
SELECT MIN(ROWID) FROM mydept
GROUP BY dname,loc);