SQL> select rowid,deptno,dname,loc from dept;
ROWID DEPTNO DNAME LOC
------------------ ---------- -------------- -------------
AAAAlXAAEAAAA53AAA 0 ss tt
AAAAlXAAEAAAA53AAB 1 tt ii
AAAAlXAAEAAAA53AAC 2 yy gg
AAAAlXAAEAAAA53AAD 1 tt uu
AAAAlXAAEAAAA53AAF 0 smlee insert
1)
SQL> select * from dept a where rowid < (select max(ROWID) from dept where dept.deptno =a.deptno)
DEPTNO DNAME LOC
---------- -------------- -------------
0 ss tt
1 tt ii
2)
SQL> select * from dept e WHERE rowid >
(SELECT min(rowid) FROM dept X WHERE X.Deptno = E.deptno);
DEPTNO DNAME LOC
---------- -------------- -------------
0 smlee insert
1 tt uu
ROWID DEPTNO DNAME LOC
------------------ ---------- -------------- -------------
AAAAlXAAEAAAA53AAA 0 ss tt
AAAAlXAAEAAAA53AAB 1 tt ii
AAAAlXAAEAAAA53AAC 2 yy gg
AAAAlXAAEAAAA53AAD 1 tt uu
AAAAlXAAEAAAA53AAF 0 smlee insert
1)
SQL> select * from dept a where rowid < (select max(ROWID) from dept where dept.deptno =a.deptno)
DEPTNO DNAME LOC
---------- -------------- -------------
0 ss tt
1 tt ii
2)
SQL> select * from dept e WHERE rowid >
(SELECT min(rowid) FROM dept X WHERE X.Deptno = E.deptno);
DEPTNO DNAME LOC
---------- -------------- -------------
0 smlee insert
1 tt uu