From: | Martin Christensen <factotum(at)mail1(dot)stofanet(dot)dk> |
---|---|
To: | Jeff Hoffmann <jeff(at)propertykey(dot)com> |
Cc: | Nikolay Mijaylov <nmmm(at)nmmm(dot)nu>, pgsql-sql(at)postgresql(dot)org |
Subject: | Re: fetching rows |
Date: | 2000-10-30 22:07:19 |
Message-ID: | 87d7gikmp4.fsf@fangorn.stofanet.dk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
>>>>> "Jeff" == Jeff Hoffmann <jeff(at)propertykey(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | hubert depesz lubaczewski | 2000-10-31 07:16:22 | Re: Synonyms |
Previous Message | Jeff Hoffmann | 2000-10-30 19:02:20 | Re: fetching rows |