Re: "Display of specified number of records."

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: "Display of specified number of records."
Дата
Msg-id 00e901c109e9$6326c640$1001a8c0@archonet.com
обсуждение исходный текст
Ответ на "Display of specified number of records."  (rajesh.prabhu@lycos.com (rajesh))
Список pgsql-sql
From: "rajesh" <rajesh.prabhu@lycos.com>

> Hi,
>   I have got following simple SQL.
>   Select TestID from test where testname = ' ' order by testdate.
>
>   Suppose for argument sake there are 100 records and testID's are 1
> to 100.
>   Is it possible to modify this SQL so that it will display records
> from 10 to 50 and not any other records.

Robby Slaughter has given one solution in another reply.

If that's not quite what you're after, and you want the 10th to 50th results
from the above query you can do:

... order by testdate limit 40 offset 10;

This calculates the results and then throws away the first nine and anything
after the 50th.

- Richard Huxton



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Richard Huxton"
Дата:
Сообщение: Re: SQL - histogram
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: can we write to a flat file from Postgresql procedure