Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SPOOKY SQL
Be careful with ROWNUM when you use an ORDER BY clause. It doesn't work
every times.
I had some problems with it, so I read in Oracle 7 RDBMS :
Oracle7 assigns a ROWNUM value to each row as it is retrieved, before rows are sorted for an ORDER BY clause, so an ORDER BY clause normally does not affect the ROWNUM of each row. However, if an ORDER BY clause causes Oracle7 to use an index to access the data, Oracle7 may retrieve the rows in a different order than without the index, so the ROWNUMs may differ than without the ORDER BY clause.
kpick_at_my-dejanews.com a écrit dans le message <7i3vec$n$1_at_nnrp1.deja.com>...
>Try adding WHERE ROWNUM < 6 and making the order by 3 decending
>
>
Received on Fri May 21 1999 - 17:46:18 CDT