query, display questions

Поиск
Список
Период
Сортировка
От Michael Hanna
Тема query, display questions
Дата
Msg-id B46415C5-AD69-11D7-80D3-00039308EB2C@hwcn.org
обсуждение исходный текст
Ответы Re: query, display questions  (Bruno Wolff III <bruno@wolff.to>)
Re: query, display questions  ("scott.marlowe" <scott.marlowe@ihs.com>)
Re: query, display questions  (Frank Bax <fbax@sympatico.ca>)
Список pgsql-php
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.

Another question: I want to echo in an html page the timestamp and the
note after it is entered. What php-pgsql commands do this?

Michael


В списке pgsql-php по дате отправления:

Предыдущее
От: Dani Oderbolz
Дата:
Сообщение: Re: user authemtication with php/postgresql
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: query, display questions