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!

sql view with rownum

731573Apr 12 2010 — edited Apr 12 2010
I apologize if this has already been asked. I did a cursory check.....

I have a view which selects year, week, and GPA (low to high with order by). I wanted to put a row number on each row so that, when I selected the mid 50%, I could then get the particular row which the low50 and the high50 resides.

I read up on ROWNUM and found the wierd output if it is put into an order by statement with the GPA. Either the GPA is ordered or the rownum is ordered, but never the twain shall meet. Is there another way around this? I have calculated the rows for about 1050 returned, to be 221 and 864. I want to then go back to row 221 and get that gpa, etc....

any ideas? (I have tried creating multi views, whereby the gpa is ordered, then second view to order the rownum...same wrong output)

Oracle 10g is the db.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2010
Added on Apr 12 2010
6 comments
1,897 views