Re: select question

Поиск
Список
Период
Сортировка
От g
Тема Re: select question
Дата
Msg-id Pine.LNX.4.21.0007310940380.19532-100000@wuwei.govshops.com
обсуждение исходный текст
Ответ на select question  (<database@gurubase.com>)
Ответы Re: select question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Alex Bolenok"
Дата:
Сообщение: Re: opaque in sql function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: gcc-version