ROWNUM is a pseudo-column that returns a row's position in a result set.
ROWNUM is evaluated AFTER records are selected from the database and BEFORE the execution of ORDER BY clause.
The following type of queries will ALWAYS return NO DATA:
... WHERE ROWNUM > x ... WHERE ROWNUM BETWEEN x AND y ... WHERE ROWNUM IN (x, y, z, ...)
However, this will work:
... WHERE ROWNUM < x
SELECT EMPNAME FROM
(SELECT EMPNAME, ROWNUM R FROM employees)
WHERE R BETWEEN 51 and 100;
Thus, if you want the next 10 results,
However, this will work:
select*from(selectt.*, ROWNUMrfromtablet)whererbetween101and120;
0 comments:
Post a Comment