SELECT
usertype,
CONCAT(start_station_name, " to", end_station_name) AS route
ROUND (AVG(cast(tripduration AS int64)/60),2) AS duration
FROM `bigquery-public-data.new_york_citibike.citibike_trips`
group by start_station_name, end_station_name, usertype
order by num_trip desc
LIMIT 100
问问题
44 次
1 回答
-1
I was just going to post this as a comment, but wanted to offer some formatting advice too
SELECT
usertype,
CONCAT(start_station_name, " to", end_station_name) AS route,
ROUND (AVG(CAST(tripduration AS int64)/60),2) AS duration
FROM `bigquery-public-data.new_york_citibike.citibike_trips`
GROUP BY
start_station_name,
end_station_name,
usertype
ORDER BY num_trip DESC
LIMIT 100
I think your issue was just the missing commas in the SELECT
and GROUP BY
sections, but I also recommend capitalizing all syntax and separating lists by indented new lines -- these things help spot errors
于 2021-09-26T20:33:15.213 回答