admin管理员组文章数量:1435859
I am a student taking an online course in data analytics. I'm learning SQL and it is my first time doing any type of coding. Recently, I've been encountering a problem where after following the instructions to the 't' I get error messages that look like this: Syntax error: Expected end of input but got "(" at [3:8]
What I've done is to let my computer sleep on it and then the following day I delete all my work and start over again. Sometimes this works. I've even reached out to the course's AI coach which could only take me so far.
Here is the SQL query:
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_trips`
GROUP BY
start_station_name, end_station_name, usertype
ORDER BY
num_trips DESC
LIMIT 10
I am a student taking an online course in data analytics. I'm learning SQL and it is my first time doing any type of coding. Recently, I've been encountering a problem where after following the instructions to the 't' I get error messages that look like this: Syntax error: Expected end of input but got "(" at [3:8]
What I've done is to let my computer sleep on it and then the following day I delete all my work and start over again. Sometimes this works. I've even reached out to the course's AI coach which could only take me so far.
Here is the SQL query:
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_trips`
GROUP BY
start_station_name, end_station_name, usertype
ORDER BY
num_trips DESC
LIMIT 10
Share
Improve this question
edited Nov 16, 2024 at 15:17
Thorsten Kettner
95.7k8 gold badges56 silver badges79 bronze badges
asked Nov 16, 2024 at 14:45
Motlalepula MmesiMotlalepula Mmesi
1
1
|
1 Answer
Reset to default -1SELECT
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_trips`
GROUP BY
start_station_name, end_station_name, usertype
ORDER BY
num_trips DESC
LIMIT 10;
本文标签: I keep getting Syntax error messages using SQL on BigQueryStack Overflow
版权声明:本文标题:I keep getting Syntax error messages using SQL on BigQuery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745656207a2668723.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
bigquery-public-data
makes delimiters probably necessary, because of the minus sign that is not to be interpreted to mean minus. But wouldn't you then use them around the name itself:FROM `bigquery-public-data`.new_york.citibike_trips
? – Thorsten Kettner Commented Nov 16, 2024 at 15:08