Re: [SQL] How Can I limit the select result ?

Поиск
Список
Период
Сортировка
От Guido Piazzi
Тема Re: [SQL] How Can I limit the select result ?
Дата
Msg-id Pine.LNX.3.96.980724111036.130B-100000@ik2gdx.ampr.org
обсуждение исходный текст
Ответ на How Can I limit the select result ?  ("¹Ú¹Ì·æ" <mrpark@tinc.co.kr>)
Список pgsql-sql
On Fri, 24 Jul 1998, ¹Ú¹Ì·æ wrote:

> I want to select like this...
>
> select * from any_table where table_field > any_no limit 10 order by
> table_field DESC;
>
> I want to select more than 1000 rows.
> But, I want to view only 10 from maximum to maximum -10.

Try using a cursor:

begin;
declare bingo cursor for
select * from any_table
where table_field > any_no
order by table_field DESC;
fetch 10 in bingo;
end;

And if I mistyped something... read the man pages.
Regards,
 -Guido-


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

Предыдущее
От: Maarten Boekhold
Дата:
Сообщение: Re: [SQL] How Can I limit the select result ?
Следующее
От: "Shawn T. Walker"
Дата:
Сообщение: Select Query Help