Re: Duration between two timestamps

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Duration between two timestamps
Дата
Msg-id 20050204175633.GC14840@svana.org
обсуждение исходный текст
Ответ на Duration between two timestamps  (phil campaigne <pcampaigne@charter.net>)
Список pgsql-general
On Fri, Feb 04, 2005 at 10:37:52AM -0500, phil campaigne wrote:
>
> Hi All,
> I have stored event records in Postgresql 7.3.4 and now need to
> calculate the duration between each event in succession.  I have
> "record_id" and a" timestamp without time zone" columns for each event.
>
> What is a good way to calculate the difference in timestamp and store it
> in the record as duration.  I am doing this as part of a java
> application on RH linux 8.0.

Have you tried just subtracting them? That will give you a value of
type "interval" which you can then store...

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Rick Apichairuk
Дата:
Сообщение: Re: [ADMIN] vacuum ran out of space and now i cant get back into db
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Questions about functionality