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

From cbbrowne@acm.org
Subject Re: Sum(time) possible?
Date
Msg-id XlWE7.22539$Fy2.4168861@news20.bellglobal.com
Whole thread Raw
In response to Re: Sum(time) possible?  (Konstantinos Agouros <elwood@agouros.de>)
List pgsql-general
elwood@agouros.de (Konstantinos Agouros) writes:
> 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.

Well, the TIME field is intended to contain something resembling a
time _stamp_.  That's not terribly compatible with your intent.

Trying a little sample:

DROP TABLE samp;
CREATE TABLE samp (
  consumed time,
  name     char(15)
);

insert into samp (consumed, name) values ('11:00', 'chris');
insert into samp (consumed, name) values ('13:00', 'dave');
insert into samp (consumed, name) values ('14:00', 'doug');

select * from samp;
select sum(consumed) from samp;
-->

DROP
CREATE
INSERT 118714 1
INSERT 118715 1
INSERT 118716 1
 consumed |      name
----------+-----------------
 11:00:00 | chris
 13:00:00 | dave
 14:00:00 | doug
(3 rows)

ERROR:  Unable to select an aggregate function sum(time)

Apparently what you want isn't completely well supported :-(.
--
(reverse (concatenate 'string "gro.gultn@" "enworbbc"))
http://www.cbbrowne.com/info/lsf.html
Twice five syllables
Plus seven can't say much but
That's haiku for you.

pgsql-general by date:

Previous
From: "Brian Hirt"
Date:
Subject: request for advise
Next
From: "Al Kirkus"
Date:
Subject: Probably simple answer