Re: how to get number of minutes?

Поиск
Список
Период
Сортировка
От Casey Duncan
Тема Re: how to get number of minutes?
Дата
Msg-id F33B3788-25A7-4F03-81DD-4729F97D2A2C@pandora.com
обсуждение исходный текст
Ответ на how to get number of minutes?  ("Chris Hoover" <revoohc@gmail.com>)
Список pgsql-general
select extract(epoch from interval '2 hours')/60;

'epoch' returns the number epoch seconds that comprise the interval.
That differs from 'seconds' which just returns the "seconds place",
which is zero for 2:00:00 of course.

-Casey

On Oct 6, 2006, at 12:22 PM, Chris Hoover wrote:

> If I subtract 2 timestamps, how do I get the results returned as
> the total number of minutes.
>
> example
>
> now() - (now()-'2 hours'::interval) = 2:00:00  -- I need the result
> returned as 120 minutes.
>
> Thanks,
>
> Chris


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

Предыдущее
От: Marc Munro
Дата:
Сообщение: Alter table alter column
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Alter table alter column