Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: selecting top performers
And the correct way to really do this is forget the abomination ROWNUM
and use a cursor, fetching rows until you have all that you need.
AFAIK, ther is no such thing as ROWNUM or ROWID in the SQL standard. So each time you use these you reduce your skill level by using this vendor specific pseudocolumns.
Why is ROWNUM bad? the key thing is that it is assigned BEFORE any sorting or ORDER BY clause. So you have to jump through hoops to get the middle 50 for example.
So just create a PL/SQL routine to get the answer for you. It's the right thing to do.
Ed Received on Mon Aug 08 2005 - 16:10:53 CDT