time calculations

Поиск
Список
Период
Сортировка
От Oliver Vecernik
Тема time calculations
Дата
Msg-id 3AF2C133.19242DA3@aon.at
обсуждение исходный текст
Ответы Re: time calculations  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Hi,

I've got a table with two columns: one for distance in km (float4) and
one for the time (interval). I'd like to calculate the speed.

My problem is how to convert the intervals to decimal hours to be able
to a simple:

SELECT *, distance/time as speed from table;

Any clues? Are there any docs (maybe I have overseen something)?

Regards,
Oliver

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: log files
Следующее
От: Tom Lane
Дата:
Сообщение: Re: time calculations