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/ |
`----------------------------------------------------------'