Re: Sum(time) possible?

Поиск
Список
Период
Сортировка
От Command Prompt, Inc.
Тема Re: Sum(time) possible?
Дата
Msg-id Pine.LNX.4.30.0111030954570.25287-100000@commandprompt.com
обсуждение исходный текст
Ответ на Re: Sum(time) possible?  (Konstantinos Agouros <elwood@agouros.de>)
Список 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 по дате отправления:

Предыдущее
От: "Command Prompt, Inc."
Дата:
Сообщение: CREATE TYPE delimiter?
Следующее
От: Kenneth Skiles
Дата:
Сообщение: trigger call shell script