简体   繁体   中英

Query not running properly

I ran a query using google big query but I get an error as a result. I don't know what could be wrong.

SELECT 
 usertype,
 CONCAT(start_station_name, " to ", end_station_name) AS route,
 COUNT(*) as num_trips,
 ROUND(AVG(CAST(tripduration AS INT64)/60),2) AS duration
FROM 
 `bigquery-public-data.new_york_citibike.citibike_stations`
GROUP BY
  start_station_name, end_station_name, usertype
ORDER BY
num_trips DESC
 LIMIT 10

You must be getting this error: Unrecognized name: usertype . As the error suggests bigquery-public-data.new_york_citibike.citibike_stations dataset doesn't have any column usertype.

As @samuel mentioned, usertype column is present in new_york_citibike.citibike_trips . Do cross check your dataset before querying.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM