Re: Retrieve month from date

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Retrieve month from date
Дата
Msg-id 1177091187.24411.25.camel@state.g2switchworks.com
обсуждение исходный текст
Ответ на Re: Retrieve month from date  (RPK <rpk.general@gmail.com>)
Список pgsql-sql
On Fri, 2007-04-20 at 12:30, RPK wrote:
> What this query will return:
> 
> Select  Extract(Month from 4/20/2007) from dual;
> 
> I suspect "dual" is not for PGSQL but Oracle. But I need to run the above
> query. What is the replacement of "dual" in PGSQL.
> 

Well, you're going to have to create a special one row table with
contraints and triggers to always keep it at one row and now allow
anyone to insert into it and...

just kidding.  All you need is:

select extract(month from '4/20/2007'::date);

i.e. no need for the extraneous from dual there.


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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Retrieve month from date
Следующее
От: Wei Weng
Дата:
Сообщение: Question on interval