Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Rownum
What about duplicate rows (which might be legal in this case) - your strategy could return less than 10 rows.
Also, as a general approach, it could require two (partial) tablescans of the table, with an undesirable overhead.
Finally, since the CBO does not guarantee
mechanism, it might be possible to get
inconsistent answers: your query is defined
so that the first half is supposed to find
more rows than the second - what happens if
the first half uses a full tablescan and
the second half uses an index scan ?
In this case you could return anything between
10 rows and 20 rows.
BTW - you can use ''<=' with rownum; I always feel uncomfortable with code that uses N+1 when the target is N.
--
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
Van Messner wrote in message ...
>This won't always work, depending on what you need to do with the rows.
But
>as a select statement you can get rows 11 to 20 by
>Select * From x Where rownum < 21
>Minus
>Select * From x Where rownum < 11;
Received on Tue May 04 1999 - 01:33:28 CDT