Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select records skipping rows in MS Access

Tags:

sql

ms-access

How do I can select some records on database skipping a number o rows in MS Access. In MySQL is LIMIT x, y. Firebird is FIRST x SKIP y etc..

No lucky on Google at all =(

like image 935
DontVoteMeDown Avatar asked May 04 '12 20:05

DontVoteMeDown


1 Answers

If you know how many records you want to skip, then you could do something like this:

SELECT *
FROM myTable x
WHERE x.ID NOT IN (SELECT Top 10 id FROM myTable ORDER BY ....)
ORDER BY ...

Then you could exclude the records that you don't want.

If you then know the total number of records that you want to return, then you could do the following:

SELECT Top 50 *
FROM myTable x
WHERE x.ID NOT IN (SELECT Top 10 id FROM myTable ORDER BY ....)
ORDER BY ...
like image 162
Taryn Avatar answered Nov 08 '22 19:11

Taryn