Re: [SQL] How Can I limit the select result ? - Mailing list pgsql-sql

From Guido Piazzi
Subject Re: [SQL] How Can I limit the select result ?
Date
Msg-id Pine.LNX.3.96.980724111036.130B-100000@ik2gdx.ampr.org
Whole thread Raw
In response to How Can I limit the select result ?  ("¹Ú¹Ì·æ" <mrpark@tinc.co.kr>)
List 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 by date:

Previous
From: Maarten Boekhold
Date:
Subject: Re: [SQL] How Can I limit the select result ?
Next
From: "Shawn T. Walker"
Date:
Subject: Select Query Help