From: | Michael Hanna <zen(at)hwcn(dot)org> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org (pgsql-novice) |
Subject: | query question |
Date: | 2003-07-03 13:23:11 |
Message-ID: | 7E7EBFE4-AD59-11D7-80D3-00039308EB2C@hwcn.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
I have a table:
michael=# \d healthnotes
Table "public.healthnotes"
Column | Type | Modifiers
--------+--------------------------
+-------------------------------------------------------------
posted | timestamp with time zone | not null default
('now'::text)::timestamp(6) with time zone
notes | text |
Indexes: healthnotes_pkey primary key btree (posted)
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?
Not sure how to go about this.
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Hanna | 2003-07-03 15:33:39 | query question |
Previous Message | Jeff | 2003-07-02 13:39:05 | Re: [NOVICE] jobs mailling list: pgsql-jobs@postgresql.org |