The equivalent of LIMIT

Discussion in 'MySQL' started by mahmood, Jan 3, 2008.

  1. #1
    Hi guys.
    What is the equivalent of LIMIT for MSAccess? For example for MySql We code:
    SELECT * FROM myTable LIMIT 100,55
    PHP:
    By the way, I don't need TOP, I need to get a range from the Access database.
     
    mahmood, Jan 3, 2008 IP
  2. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't think that "clever" MS have thought about a LIMIT :) Use an array of the results instead and it should get you the desired output.
     
    maiahost, Jan 3, 2008 IP
  3. mahmood

    mahmood Guest

    Messages:
    1,228
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I get that impression too. Using the array of results leave the problem of performance intact.
     
    mahmood, Jan 3, 2008 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The Equiv of LIMIT is TOP and it is placed after the Select command (eg SELECT TOP 10 * FROM Table1)

    The problem with it is the fact that it only takes a single value so you cannot use it to offset as you can with LIMIT. You can get round it a number of ways such as with sub queries (eg SELECT TOP 20 * FROM Table1 WHERE table1.ID NOT IN (SELECT TOP 10 Table1.ID FROM Table1)) and with SQL you can add an auto number column and filter using it but I dont know if this works with access)
     
    AstarothSolutions, Jan 4, 2008 IP