Re: select question - Mailing list pgsql-general

From g
Subject Re: select question
Date
Msg-id Pine.LNX.4.21.0007310940380.19532-100000@wuwei.govshops.com
Whole thread Raw
In response to select question  (<database@gurubase.com>)
Responses Re: select question
List pgsql-general
Use the limit clause.

SELECT message_text FROM messages ORDER BY creation_date LIMIT $limit,
$offset.

LIMIT 10, 0 gets you the first batch.
LIMIT 10, 10 gets you the second batch.
LIMIT 10, 20 gets you the third, etc.


-----------------------------------------
Water overcomes the stone;
Without substance it requires no opening;
This is the benefit of taking no action.
            Lao-Tse

Brian Knox
Senior Systems Engineer
brian@govshops.com

On Sun, 30 Jul 2000 database@gurubase.com wrote:

> Dear all,
>
> Is there a way I can select the top 50 rows from table, 51 - 100 rows from
> table etc.... (with order clause)? It is because I am writing a message board
> and I would like to create the prev/next button on different page.
>
> Many thanks.
>
> Best regards,
> Boris
>


pgsql-general by date:

Previous
From: "Alex Bolenok"
Date:
Subject: Re: opaque in sql function
Next
From: Tom Lane
Date:
Subject: Re: gcc-version