Re: Querying date_time for date only ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Querying date_time for date only ?
Дата
Msg-id 29114.1135091137@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Querying date_time for date only ?  (Michael Burke <michael@engtech.ca>)
Список pgsql-sql
Michael Burke <michael@engtech.ca> writes:
> On December 20, 2005 08:59 am, Aarni Ruuhim�ki wrote:
>> I have a time stamp without time zone field, YYYY-MM-DD hh:mm:ss, in my
>> table. I want to also find something just for a particular day regardless
>> of the time.

> You can try,
> SELECT field::date FROM mytable;

The date_trunc() function can also be useful for this sort of thing,
particularly if you need to round off to something finer or coarser
than days.
http://www.postgresql.org/docs/8.1/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
        regards, tom lane


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

Предыдущее
От: Michael Burke
Дата:
Сообщение: Re: Sub-query as function argument
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Sub-query as function argument