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: (view raw, whole thread or download thread mbox)
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.


GPG public key:

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-2017 The PostgreSQL Global Development Group