Information générale
Forum:
Microsoft SQL Server
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement