Re: Query to find list of dates between two dates

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Query to find list of dates between two dates
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C20393814E@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Query to find list of dates between two dates  (aravind chandu <avin_friends@yahoo.com>)
Список pgsql-general
aravind chandu wrote:
> can you please help me with the following query
>
> I need a query that displays all the dates in between two
> dates say i give two dates 12/1/2009 and 12/31/2009 The
> result should be like this
>
> 12/1/2009
> 12/2/2009
> 12/3/2009
>
> .
> .
> .
> .
> .
> 12/31/2009
>
> Note : Assume that there is no table

SELECT CAST(d AS date)
FROM generate_series(
        CAST('2009-12-01' AS timestamp with time zone),
        '2009-12-31',
        '1 day') AS g(d);

Yours,
Laurenz Albe

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

Предыдущее
От: RW
Дата:
Сообщение: Re: Idle in Transaction
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Verify a record has a column in a plpgsql trigger