Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Finding Average Timestamp

767018Aug 19 2010 — edited Aug 19 2010
Hey,

I have a table with two columns: FILE_ID (NUMBER), ARRIVAL_TIME (TIMESTAMP).

I want to figure out the average ARRIVAL_TIME for a given file. I can't seem to find out how to do this. When I try to execute the following:

SELECT AVG(V.ARRIVAL_TIME)
FROM FILE_ARRIVALS V WHERE FILE_ID = SOME_NUMBER

I get this error:

ORA-00932: inconsistent datatypes: expected NUMBER got TIMESTAMP

I've found many examples of getting the average timespan between two timestamps or dates, but they don't fit my needs.

Thanks!

Jeffrey Kevin Pry

Edited by: jeffrey.pry on Aug 19, 2010 5:44 AM
This post has been answered by John Spencer on Aug 19 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2010
Added on Aug 19 2010
14 comments
8,356 views