pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: angelo.rigo@globo.com
Cc: pgsql-php@postgresql.org
Subject: Re: timezone
Date: Thu, 1 Aug 2002 12:09:19 -0700
Message-ID: <200208011209.19576.josh@agliodbs.com> (raw)
In-Reply-To: <3D3EEC5F00026068@riosf05.globoi.com>
References: <3D3EEC5F00026068@riosf05.globoi.com>

Angelo,

> how can i display 20 results at a time and give a link to the next 20 or
> 50 or whatever records i do have on the database?

Use LIMIT and OFFSET, which work the same in Postgres and MySQL:

SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
 FROM aprovados
 ORDER BY nome ASC
 LIMIT 20 OFFSET 0;

then

SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
 FROM aprovados
 ORDER BY nome ASC
 LIMIT 20 OFFSET 20;

etc.

-- 
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology 	josh@agliodbs.com
    and data management solutions 	(415) 565-7293
   for law firms, small businesses 	 fax 621-2533
    and non-profit organizations. 	San Francisco




view thread (6+ messages)  latest in thread

Message-ID: <200208011209.19576.josh@agliodbs.com>
Permalink:  ../200208011209.19576.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200208011209.19576.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: josh@agliodbs.com, angelo.rigo@globo.com
  Subject: Re: timezone
  In-Reply-To: <200208011209.19576.josh@agliodbs.com>
  References: <3D3EEC5F00026068@riosf05.globoi.com> <200208011209.19576.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox