Re: Sum(time) possible?

Поиск
Список
Период
Сортировка
От cbbrowne@acm.org
Тема Re: Sum(time) possible?
Дата
Msg-id XlWE7.22539$Fy2.4168861@news20.bellglobal.com
обсуждение исходный текст
Ответ на Re: Sum(time) possible?  (Konstantinos Agouros <elwood@agouros.de>)
Список 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 по дате отправления:

Предыдущее
От: "Brian Hirt"
Дата:
Сообщение: request for advise
Следующее
От: "Al Kirkus"
Дата:
Сообщение: Probably simple answer