Skip site navigation (1) Skip section navigation (2)

Re: fetching rows

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 (view raw or flat)
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

In response to

pgsql-sql by date

Next:From: hubert depesz lubaczewskiDate: 2000-10-31 07:16:22
Subject: Re: Synonyms
Previous:From: Jeff HoffmannDate: 2000-10-30 19:02:20
Subject: Re: fetching rows

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group