Re: How do you get the year from a postgresql DATE?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: How do you get the year from a postgresql DATE?
Дата
Msg-id 20091023170326.C86506@megazone.bigpanda.com
обсуждение исходный текст
Ответ на How do you get the year from a postgresql DATE?  (Mary Anderson <maryfran@demog.berkeley.edu>)
Ответы Re: How do you get the year from a postgresql DATE?  ("...tharas" <tharasp@gmail.com>)
Список pgsql-novice
On Fri, 23 Oct 2009, Mary Anderson wrote:

>     Honest, I am not really a newbie, but I don't see any postgresql
> function to do this in the documentation.  I want to do something like
>
> CREATE TABLE mydate(fu DATE);
> INSERT INTO mydate VALUES ('2000-01-01');
> SELECT EXTRACT(YEAR FROM DATE fu) FROM mydate;

I think you'd just want something like:
 SELECT EXTRACT(YEAR FROM fu) FROM mydate;

DATE '2000-01-01' is a syntax for providing a date literal, not treating
an expression as a date.

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

Предыдущее
От: Mary Anderson
Дата:
Сообщение: How do you get the year from a postgresql DATE?
Следующее
От: "...tharas"
Дата:
Сообщение: Re: How do you get the year from a postgresql DATE?