Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ROWNUM problem...
The problem is that ROWNUM is assigned sequentially to each row that meets
the criteria. Oracle's SQL Language Reference Manual explains why no rows
are selected when you test for ROWNUM values greater than 1 (i.e. ROWNUM >
10):
"The first row fetched is assigned a ROWNUM of 1 and makes the condition false. The second row to be fetched is now the first row and is also assigned a ROWNUM of 1 and also makes the condition false."
As to how you can retreive the next 10 rows, the easy way is to use PL/SQL, but I suspect that's not what you want. I have never tried this in SQL, so I have absolutely no idea whether it'll work, but you could try the following:
SELECT ROWNUM, MAX(a)
FROM aaa
GROUP BY ROWNUM
HAVING ROWNUM > 10
Received on Thu Apr 30 1998 - 18:39:19 CDT
![]() |
![]() |