Thursday, March 5, 2009

Row number

Select the first n rows
the following example show how to retrieves the first 15 rows

select emp_name, salary
from employee
where rownum <=15


if you want to retrieve data between row number 10 and row number 15
then it should be in the following way

select emp_name, salary
from
(select rownum r ,emp_name, salary
From employee )
Where r >=10 and r<=15

No comments:

Post a Comment