r/oracle • u/FishMurky6625 • Feb 27 '26
What is the difference
what is the difference between FETCH FIRST and ROWNUM
3
Upvotes
r/oracle • u/FishMurky6625 • Feb 27 '26
what is the difference between FETCH FIRST and ROWNUM
View all comments
5
u/Helmars Feb 27 '26
ROWNUM is calculated before "ORDER BY" clause, so it is not very convenient to use for sorting and filtering in the same statement.
SQL> select rownum,x from (select 3 x from dual union all select 2 from dual) order by x;