Re: [SQL] Restricting number of entries returned - Mailing list pgsql-sql

From Zsolt Varga
Subject Re: [SQL] Restricting number of entries returned
Date
Msg-id Pine.LNX.3.96.980716000405.21940A-100000@lupus.agria.hu
Whole thread Raw
In response to Restricting number of entries returned  ("Neil Burrows" <neil@remo.demon.co.uk>)
List pgsql-sql
On Wed, 15 Jul 1998, Neil Burrows wrote:

|Hi,
|
|Is there any way of restricting the number or entries returned in an SQL
|query?
|
|For example, if you wanted to do a select that ordered the results by a
|certain field, and only wanted the "Top 10" entries, is there any way to
|specify that you just want the 1st 10 records?

I don't know is there any simple solution
but you can do it with cursors

begin;
declare curs01 cursor for select artist,music,vote from musicdb order by
  vote descending;
fetch 10 in curs01;
end;

    redax

.----------------------------------------------------------.
|Zsolt Varga            | tel/fax:   +36 36 422811         |
| AgriaComputer LTD     | email:     redax@agria.hu        |
| System Administrator  | URL:       http://www.agria.hu/  |
`----------------------------------------------------------'


pgsql-sql by date:

Previous
From: "Neil Burrows"
Date:
Subject: Restricting number of entries returned
Next
From: "Ounnapirak, Chotiwat"
Date:
Subject: RE: pgsql-sql-digest V1 #9