Re: find last day of month

Поиск
Список
Период
Сортировка
От Jeffrey Melloy
Тема Re: find last day of month
Дата
Msg-id 4398C068.1050806@visualdistortion.org
обсуждение исходный текст
Ответ на find last day of month  ("Andrus Moor" <eetasoft@online.ee>)
Список pgsql-general
Andrus Moor wrote:

>I have a table containing month column in format mm.yyyy
>
>create table months ( tmkuu c(7));
>insert into months values ('01.2005');
>insert into months values ('02.2005');
>
>How to create select statement which converts this column to date type
>containing last day of month like
>
>'2005-01-31'
>'2005-02-28'
>
>Andrus.
>
>
select to_date(tmkuu, 'mm.yyyy') + '1 month'::interval - '1
day'::interval from months; will convert it to a timestamp.  You can
further downcast to date if you need to.

Jeff

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

Предыдущее
От: "Andrus Moor"
Дата:
Сообщение: find last day of month
Следующее
От: Chris Velevitch
Дата:
Сообщение: How efficient is select currval?