Re: extract day from interval

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: extract day from interval
Дата
Msg-id 23849.1206677219@sss.pgh.pa.us
обсуждение исходный текст
Ответ на extract day from interval  (Seb <spluque@gmail.com>)
Список pgsql-general
Seb <spluque@gmail.com> writes:
>        EXTRACT(DAY FROM (table_b.date - table_a.date)) AS age,

> Is this an efficient way to get the days from the time interval?  Both
> 'date' columns are of type "Date".  Thanks.

Efficiency is moot, it's just plain wrong.  Or at least something is
wrong here, Subtraction of two "date" values gives an integer number of
days already, so I'd expect the EXTRACT to fail altogether.  You
sure the date columns are type date and not type timestamp?

            regards, tom lane

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

Предыдущее
От: Seb
Дата:
Сообщение: extract day from interval
Следующее
От: Seb
Дата:
Сообщение: Re: extract day from interval