Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2005

    Unanswered: MySQL limit with start, offset


    I need the equivalent for below mysql query :

    select *from test limit 5, 20

    I know that the below is possible in SQL Server :

    select top 20 * from test where column1 not in (select top 5 column1 from test).

    But my problem is I want a generic solution wherein I will not be aware of the columns available within the table.

    Please advice,

    - Mira

  2. #2
    Join Date
    Jun 2003
    Provided Answers: 1
    Without knowing the columns? You need to understand that TOP is meaningless in a relational database (SQL Server or MySQL) without an ORDER BY clause that specifies a column. Otherwise, you have no guarantee about the order of the data that comes back, and it can change from one execution to the next.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts