Re: caculating while select - maybe sum ? - Mailing list pgsql-general

From Frank Bax
Subject Re: caculating while select - maybe sum ?
Date
Msg-id 3.0.6.32.20020205112125.02257e40@pop6.sympatico.ca
Whole thread Raw
In response to caculating while select - maybe sum ?  ("Ben-Nes Michael" <miki@canaan.co.il>)
Responses Re: caculating while select - maybe sum ?
List pgsql-general
I'm not quite sure what you're asking for; but it shoulds like you want:
    age(timestamp,timestamp) => interval
For example:
select age('2002-12-25',now());
           age
--------------------------
 10 mons 19 days 12:30:28
(1 row)

Frank

At 04:17 PM 2/5/02 +0200, Ben-Nes Michael wrote:
>Hi All
>
>im trying to calculate hour usage so a typical row is: 1. enter time, 2.
>exit time 3. sum() until this row
>
>Couldn't use sum() as it ask me to 'group by' which I don't want.
>
>Is there a way to add the previous row value to the current, per row ?
>
>example:
>select row1, row2, (row1 + row2 until now) from table;
>
>--------------------------
>Canaan Surfing Ltd.
>Internet Service Providers
>Ben-Nes Michael - Manager
>Tel: 972-4-6991122
>http://sites.canaan.co.il
>--------------------------

pgsql-general by date:

Previous
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: PostgreSQL v7.2 Final Release
Next
From: Ben-Nes Michael
Date:
Subject: Re: caculating while select - maybe sum ?