interval as hours or minutes ?

Поиск
Список
Период
Сортировка
От Aarni Ruuhimäki
Тема interval as hours or minutes ?
Дата
Msg-id 200702071903.35126.aarni@kymi.com
обсуждение исходный текст
Ответы Re: interval as hours or minutes ?  (Bricklen Anderson <banderson@presinet.com>)
Re: interval as hours or minutes ?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: interval as hours or minutes ?  (Bruno Wolff III <bruno@wolff.to>)
Re: interval as hours or minutes ?  ("Jan Muszynski" <postgres@jancm.org>)
Список pgsql-sql
Hi all,

Could anyone please tell an easy way to get total hours or minutes from an
interval ?

SELECT SUM(stop_date_time - start_date_time) AS tot_time FROM work_times WHERE
user_id = 1;   tot_time
-----------------2 days 14:08:44

I'd like to have this like ... AS tot_hours ...   tot_hours
-----------------
62

and ... AS tot_minutes ...   tot_minutes
-----------------
3728

Maybe even ... AS tot_hours_minutes_seconds   tot_hours_minutes_seconds
-----------------
62:08:44


start_date_time and stop_date_time are stored as timestamp without time zone,
using Pg 8.1.5 on CentOs 4.4

???

Thanks,

--
Aarni Ruuhimäki



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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Removing duplicate rows
Следующее
От: Bricklen Anderson
Дата:
Сообщение: Re: interval as hours or minutes ?