Re: query, display questions

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Michael Hanna <zen(at)hwcn(dot)org>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: query, display questions
Date: 2003-07-03 15:36:13
Message-ID: 20030703153613.GA21908@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Thu, Jul 03, 2003 at 11:19:14 -0400,
Michael Hanna <zen(at)hwcn(dot)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.

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Nick Barr 2003-07-03 15:39:21 Re: query, display questions
Previous Message scott.marlowe 2003-07-03 15:31:12 Re: query, display questions