Select records skipping rows in MS Access

后端 未结 1 1648
傲寒
傲寒 2020-12-11 18:20

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..

<
相关标签:
1条回答
  • 2020-12-11 19:12

    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 ...
    
    0 讨论(0)
提交回复
热议问题