Re: fetching rows - Mailing list pgsql-sql

From Martin Christensen
Subject Re: fetching rows
Date
Msg-id 87d7gikmp4.fsf@fangorn.stofanet.dk
Whole thread Raw
In response to fetching rows  ("Nikolay Mijaylov" <nmmm@nmmm.nu>)
List pgsql-sql
>>>>> "Jeff" == Jeff Hoffmann <jeff@propertykey.com> writes:
Jeff> you can't do that with a cursor, but you can use they mysql-ism
Jeff> called a limit clause.  for example, to fetch rows 26-50 from
Jeff> that query, you'd do:
Jeff> select * from films limit 25,26;
Jeff> or
Jeff> select * from files limit 25 offset 26;

Since there's no particular ordering of the output of such a query it
is necessary to explicitly state an ordering key. Otherwise you'll
quickly find that the phase of the moon has very significant influence
on the produced results. :-) Especially in 7.*, as I understand it.

Martin

-- 
GPG public key: http://home1.stofanet.dk/factotum/gpgkey.txt


pgsql-sql by date:

Previous
From: Jeff Hoffmann
Date:
Subject: Re: fetching rows
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: Synonyms