Search code examples
phpmysqlsqllimit

SQL get results 21-30?


This seems like a really simple question but I can't seem to find information on it.

If I have 100 results, and I only want to get the results results between 21 and 30 (from the order my SQL query is grabbing them), how would I accomplish this?


Solution

  • You can use this:

    LIMIT 20, 10
    

    E.g.,

    select *
    from MyTable
    LIMIT 20, 10