Re: query question

Поиск
Список
Период
Сортировка
От Manuel Sugawara
Тема Re: query question
Дата
Msg-id m31xx71twy.fsf@conexa.fciencias.unam.mx
обсуждение исходный текст
Ответ на query question  (Michael Hanna <zen@hwcn.org>)
Список pgsql-novice
Michael Hanna <zen@hwcn.org> writes:

> 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.

Try casting the timestamp to date,

select * from healthnotes where cast(posted as date) = 'your date here';

Regards,
Manuel.

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

Предыдущее
От: Michael Hanna
Дата:
Сообщение: query question
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: query question