Re: date with month and year

Поиск
Список
Период
Сортировка
От Paul Jungwirth
Тема Re: date with month and year
Дата
Msg-id 555E122F.9050307@illuminatedcomputing.com
обсуждение исходный текст
Ответ на date with month and year  (Daniel Torres <nobeeakon@gmail.com>)
Список pgsql-general
> Is it possible to have date type data that only contain month and year?,
> how can I obtain that from a timestamp (without time zone) column?

I think you want date_trunc, which will cut everything down to the first
of the month, e.g 2015-01-01, 2015-02-01, etc. The results will still be
dates, so you can still use date functions to manipulate them.

Paul






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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: date with month and year
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: date with month and year