Re: Sum(time) possible?
От | elwood@agouros.de (Konstantinos Agouros) |
---|---|
Тема | Re: Sum(time) possible? |
Дата | |
Msg-id | elwood.1005115331@news.agouros.de обсуждение исходный текст |
Ответ на | Re: Sum(time) possible? ("Command Prompt, Inc." <pgsql-general@commandprompt.com>) |
Список | pgsql-general |
In <3BE84D1E.23C58E5@incentre.net> guy@incentre.net (Guy Fraser) writes: >Hi >Here are some of my preferances, that I have found to be easier to work with doing >this. >"Command Prompt, Inc." wrote: >> discrete length of time in temporal units, and you can perform a sum() on >> its values. >> >Yuk. Use reltime it has better conversions. >"reltime" converts seconds to "int4" and vice versa. > select reltime('-3600'::int4); > reltime >----------- > 01:00 ago >(1 row) >select int4('1 day'::reltime); > int4 >------- > 86400 >(1 row) >If you use intervals you first need to convert them to reltime. Hmmm reltime also gets me seconds. But to get seomthing like: 200:5:2 meaning 200 hours, 5 minutes 2 seconds I have to define my own function, correct? Konstantin -- Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185 ---------------------------------------------------------------------------- "Captain, this ship will not survive the forming of the cosmos." B'Elana Torres
В списке pgsql-general по дате отправления: