Re: DISTINCT ON troubles

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: DISTINCT ON troubles
Дата
Msg-id Pine.LNX.4.33.0402191439001.7167-100000@css120.ihs.com
обсуждение исходный текст
Ответ на Re: DISTINCT ON troubles  (Brian Knox <laotse@aol.net>)
Ответы Re: DISTINCT ON troubles  ("scott.marlowe" <scott.marlowe@ihs.com>)
Re: Date Foo.  (Brian Knox <laotse@aol.net>)
Список pgsql-sql
On Thu, 19 Feb 2004, Brian Knox wrote:

> ( sorry if this is a repeat, my mail server is being wonky today )
> 
> I'm looking for a way, within SQL, given a starting date and an ending 
> date, to get back the number of months between the start and end date. 
> If I "SELECT end_date - start_date", I get back an interval in days; I 
> need months.

Maybe date_part?

select date_part('month','2004-08-02 12:00:00'::timestamp) - 
date_part('month','2004-05-01 12:00:00'::timestamp);



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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Compiling pl/pgsql functions
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: DISTINCT ON troubles