[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] how to use the LIMIT and OFFSET?
From:       Stephen Leaf <smileaf () smileaf ! org>
Date:       2005-07-02 17:15:15
Message-ID: 200507021215.15770.smileaf () smileaf ! org
[Download RAW message or body]

On Saturday 02 July 2005 12:10 pm, jack wu wrote:
> i am trying to run some web search like query. the one
> that returns a total number of results and only
> presents the first 20, then allows user to click on
> next to go to the next 20 etc.
>
> has anyone done this before? i suppose i would use
> LIMIT or OFFSET in the select statement, but the
> offset only skips certain number of results before the
> results i want to show, am i right?
>
> so if i have 60 results, using OFFSET, i could skip
> the first 20, and get the rest of 40, but i can't say,
> give me the second 20.
>
> thanks for you advice

SELECT * FROM table LIMIT X, Y
Where X is the Offset and Y is the Limit.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic