Обсуждение: Re: sum ( time) problem

Поиск
Список
Период
Сортировка

Re: sum ( time) problem

От
Willem de Jong
Дата:
"Loeke" <LoekeDoeLoekeDoe@dontlikespam.hotmail.com> wrote in
Dan heb je nog de 24-uurs notatie, en krijg je niet een result boven de 
24-uurs notatie.

news:1084406549.228484@seven.kulnet.kuleuven.ac.be: 

> kijk eens bij functions and operators van de
> sql help bij pgadmin
> 
> "Willem de Jong" <Willumpie@xs4all.nl> wrote in message
> news:Xns94E7AEA1D11BBJongdatdnaservicesdo@200.46.204.72...
>> Hello,
>>
>> 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?
>>
>> thanks in advance,
>>
>> Willem de Jong.
> 
> 



Re: sum ( time) problem

От
Bruno Wolff III
Дата:
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.


Re: sum ( time) problem

От
Willem de Jong
Дата:
I'm afraid it is the only solution...
Thanks for reply


bruno@wolff.to (Bruno Wolff III) wrote in news:20040601140334.GA24188
@wolff.to:

> 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.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
> 
>