I did this with:-
declare tmp cursor for select * from table;fetch forward 10 in tmp;
But if someone else has a better way, please let me know....
On Sat, 7 Nov 1998, Sergio wrote:
> Sferacarta Software <sferac@bo.nettuno.it> el d�a Mon, 9 Nov 1998 14:33:06
> +0100, escribi�:
>
> >Hello Radhakrishnan,
> >
> >luned�, 9 novembre 98, you wrote:
> >
> >
> >RCV> how can i limit the number of rows obtained from a select statement
> >RCV> in postgreSQL to say, 10 rows while the select condition actually
> >RCV> matches more than that. in oracle we can use the ROW_NUM variable
> >RCV> for this purpose but now i met such an issue with postgreSQL
> >
> >On v6.4 you can specify a limit for queries as:
> >
> >set QUERY_LIMIT TO '10';
> >To have only the first 10 rows from a select;
>
> this will limit _all_ the querys, right ?
> wich is not very flexible.
>
> I can't do something like
>
> select * from news order by news_date limit 10
>
> ?
>
> Sergio
>
>
James (james@linuxrocks.co.uk)
Vortex Internet
My Windows unders~1 long filena~1, and yours?