time calculations

From: Oliver Vecernik <vecernik(at)aon(dot)at>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: time calculations
Date: 2001-05-04 14:48:19
Message-ID: 3AF2C133.19242DA3@aon.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message tsattler 2001-05-04 15:12:00 Queries
Previous Message Tom Lane 2001-05-04 13:51:07 Re: log files