Re: Sum(time) possible? - Mailing list pgsql-general

From Command Prompt, Inc.
Subject Re: Sum(time) possible?
Date
Msg-id Pine.LNX.4.30.0111030954570.25287-100000@commandprompt.com
Whole thread Raw
In response to Re: Sum(time) possible?  (Konstantinos Agouros <elwood@agouros.de>)
List pgsql-general
On Sat, 3 Nov 2001, Konstantinos Agouros wrote:
>On Sat, Nov 03, 2001 at 09:33:35AM -0800, Andrew Gould wrote:
>>Are you trying to sum times or lengths of time?
>Yup. A little background the column hold the time someone works on a project.
>At the end of the month I want to see the total time. If time is not the right
>column type for this please let me know.

Sounds like you want an interval data type, not time. Interval describes a
discrete length of time in temporal units, and you can perform a sum() on
its values.

You could possibly instead have a start_timestamp column and an
end_timestamp column, and do a sum(end_timestamp - start_timetstamp), if
you need to track more than just the interval; subtracting a timestamp
from another timestamp will yield an interval.


Regards,
Jw.
--
jlx@commandprompt.com
by way of pgsql-general@commandprompt.com


pgsql-general by date:

Previous
From: "Command Prompt, Inc."
Date:
Subject: CREATE TYPE delimiter?
Next
From: Kenneth Skiles
Date:
Subject: trigger call shell script