0

I created a column to track the time that passed between a start time and the end time of a bike ride. The column saved as an Interval like this "0-0 0 -0:16:15" I'm trying to find the average ride time interval, but I feel like converting it to TIME or FLOAT will give me a more accurate ride time. When I used the average function for the column as Interval data type I felt it was inaccurate.

This was the average function I used:

SELECT AVERAGE(ride_time)

FROM nifty-rex-386114.cyclistic_case_study.2_cleaned_2023_04

WHERE member_type = casual

2 questions:

  1. Would it be helpful to change the data type of this column from INTERVAL to TIME or FLOAT?
  2. How would I do that?
  3. And what's the best way for me to find the Average?

p.s. I'm working in BigQuery

1 Answers1

0

I do not see any AVERAGE() function in BigQuery documentation. I also have not found any other dialect of SQL that has AVERAGE statement.

There is no much difference what type of data you are averaging. So keeping data in original format should suffice.

Oleg.S
  • 1
  • 3