Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: "Delta" or "elapsed" time column in Oracle
Oracle 9i and up implement the INTERVAL DAY TO SECOND SQL datatype.
"Bill McLaughlin" <mcbill20_at_hotmail.com> wrote in message
news:e9cbc4f2.0406020210.674fd90c_at_posting.google.com...
> Hello all. I browsed through the Oracle groups looking for an answer
> to this and I found it asked before but in different circumstances.
>
> I am trying to use a column to store just a time with no date. The
> other posters that I saw were told to just make sure the date is the
> same for all columns and use a normal date column. However, it
> appeared to me that most people that asked the question were looking
> for an absolute time-- i.e. 12:17AM and they just don't care about the
> date. I am looking to store an elapsed time, like 47 minutes and 20
> seconds.
>
> I am trying to store race results and am therefore looking for a
> column type to store a value that I can easily do computations on. For
> example, "What is the mean time for all runners that are male and
> between the ages of 17 and 24?" or "select all runners where finish
> time is between 45 minutes and 50 minutes".
>
> The times I am loading into the table are ascii and in 'hh:mi:ss'
> format.
>
> I would appreciate some recommendations based on the queries I
> mentioned. I can easily write a program to convert the times to
> seconds and use an integer column, but I don't know if that is a good
> way to go. Any suggestions?
>
> Thanks.
Received on Wed Jun 02 2004 - 12:39:46 CDT