Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

row numbers, how to set a row number on my query

18038Sep 29 2001
Hi,

I wonder why oracle treats rownum field as an ordinary field.
Say I run this query:

SELECT ROWNUM, NAME FROM MYTABLE;
it works nice but if I add an ORDER BY phrase:

SELECT ROWNUM, NAME FROM MYTABLE ORDER BY NAME;
then the rownum field gets shuffled!

I need to have a field as the row number in my query, since it's
the only way to paginate the output, for example displaying the
first 15 rows in the first page...

Any help is so much appreciated
Thanks :)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2001
Added on Sep 29 2001
8 comments
643 views