General information
Forum:
Microsoft SQL Server
Title:
Query for next set of records
Hi All,
Is there a way in SQL to get the next batch of record set?
Example I have 100 records in the table then I want to return the record set by 10.
Let:
select first 10 records (from 1 to 10, this is possible using top keyword e.g. select top 10 * from tablename)/
How about next 10 records (e.g. from 11 to 20, 21 to 30, 31 to 40 and so on..)?
In oracle it is possible by using rownum as follows:
select x.emp_name from (select rownum y, emp_name from emp where city='newyork')x where x.y between 20 and 30
Can we do this trick in SQL Server or any other technique to achieve the result.
Thanks,
Rene
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only