提问人:Heather Bobbitt 提问时间:11/15/2023 最后编辑:marc_sHeather Bobbitt 更新时间:11/15/2023 访问量:41
尝试解决 Coursera 问题并不断出现语法错误 [重复]
Trying to solve a Coursera problem and keep getting syntax error [duplicate]
问:
我正在尝试在Bigquery中完成此查询,但继续出现语法错误。我做错了什么???我已经查看了其他解决方案,但我找不到无法运行查询的原因。
WITH longest_used_bike AS
(
SELECT
bikeid,
SUM(duration_minutes) AS trip_duration
FROM
bigquery-public-data.austin_bikeshare.bikeshare_trips
GROUP BY
bikeid
ORDER BY
trip_duration DESC
LIMIT 1
)
答:
0赞
Eric Martin
11/15/2023
#1
也许有第二个选择来消耗你的 cte 和限制 1 外面:
WITH longest_used_bike AS
(
SELECT
bike_id,
SUM(duration_minutes) AS trip_duration
FROM
`bigquery-public-data.austin_bikeshare.bikeshare_trips`
GROUP BY
bike_id
)
SELECT *
FROM longest_used_bike
ORDER BY trip_duration DESC
LIMIT 1;
评论