SQL kaggle learn with as excercise

SQL kaggle learn with as excercise,第1张

SQL kaggle learn with as excercise
rides_per_year_query = """
SELECT EXTRACT(YEAR FROM trip_start_timestamp) AS year ,COUNT(unique_key) AS num_trips
FROM `bigquery-public-data.chicago_taxi_trips.taxi_trips`
GROUP BY year
ORDER BY year
#运行报错
Query cancelled; estimated size of 5.255455803126097 exceeds limit of 1 GB
None



rides_per_year_query = """
SELECT EXTRACT(YEAR FROM trip_start_timestamp) AS year ,COUNT(1) AS num_trips
FROM `bigquery-public-data.chicago_taxi_trips.taxi_trips`
GROUP BY year
ORDER BY year """
#返回正确结果
 year  num_trips
0 2013 26870287
1 2014 31021726
2 2015 27400744
3 2016 19878276
4 2017 7689021
 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/587834.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-12
下一篇 2022-04-12

发表评论

登录后才能评论

评论列表(0条)

保存