Re: sum ( time) problem

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: sum ( time) problem
Дата
Msg-id 20040601140334.GA24188@wolff.to
обсуждение исходный текст
Ответ на Re: sum ( time) problem  (Willem de Jong <Willumpie@xs4all.nl>)
Список pgsql-sql
On Thu, May 27, 2004 at 11:14:58 +0000, Willem de Jong <Willumpie@xs4all.nl> wrote:
> >>
> >> If i do a sum(time) the result is like this '1 day 18:00:00'. But i'd
> >> like to get a result like this '42:00:00'.
> >>
> >> How can i realise is by a query?

You can do something like the following: (not completely tested)
select extract(epoch from sum(time))/3600 || ':' || extract(minutes from sum(time)) || ':' || extract(seconds from
sum(time));

I am not sure if the above will work right for negative intervals.


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

Предыдущее
От: "email lists"
Дата:
Сообщение: assistance on self join pls
Следующее
От: Chris Gamache
Дата:
Сообщение: Schemata & User-Defined-Type casting issues