Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: "Delta" or "elapsed" time column in Oracle
Thanks to both of you for the info. I ended up using the INTERVAL DAY
TO SECOND to store the data. I hope I made the right choice. Now my
main problem is using this column in calculations. It's easy to select
based on interval ranges, but I am having difficult using other
functions (like mean and average) as they are expecting numeric
values. I am going through the SQL reference to find the solution.
However, if anyone can point me to any specific documentation or
examples I'd appreciate it.
Thanks in advance.
Bill
"David Best" <davebest_at_usa_dot_net> wrote in message news:<X-ydnY_7luJ_jSPdRVn-gQ_at_speakeasy.net>...
> 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 Fri Jun 04 2004 - 01:16:36 CDT