pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Michael Hanna <zen@hwcn.org>
Cc: pgsql-php@postgresql.org
Subject: Re: query, display questions
Date: Thu, 3 Jul 2003 10:36:13 -0500
Message-ID: <20030703153613.GA21908@wolff.to> (raw)
In-Reply-To: <B46415C5-AD69-11D7-80D3-00039308EB2C@hwcn.org>
References: <B46415C5-AD69-11D7-80D3-00039308EB2C@hwcn.org>

On Thu, Jul 03, 2003 at 11:19:14 -0400,
  Michael Hanna <zen@hwcn.org> wrote:
> 
> Often there are multiple entries per day. I want to display the day  
> once, with all the entries on that day.
> 
> So do I select * from notes and group by date, then write a nested  
> for-loop in php that ignores the extra timestamp items? Seems a little  
> inelegant. Or can I select distinct timestamps somehow after converting  
> them to dates?

I think the normal thing to do here is have the application check that
the date for the current row is the same as for the previous row
and suppress the date in that case. If the repeated information was
large enough that just transferring the rows from the backend to the
frontend was the bottleneck, then you might be better off getting
the list of per information in a cursor and then for each day
get the records for that day. I can't imagine this being the case
if the only redundant information was the date.



view thread (5+ messages)  latest in thread

Message-ID: <20030703153613.GA21908@wolff.to>
Permalink:  ../20030703153613.GA21908@wolff.to/
Also on:    postgresql.org/message-id/20030703153613.GA21908@wolff.to

 · 

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: bruno@wolff.to, zen@hwcn.org
  Subject: Re: query, display questions
  In-Reply-To: <20030703153613.GA21908@wolff.to>
  References: <B46415C5-AD69-11D7-80D3-00039308EB2C@hwcn.org> <20030703153613.GA21908@wolff.to>

* 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