728x90
as-with
-
캐글 intro_to_sql/05-as-with<Kaggle-Course> 2023. 3. 15. 15:36
rides_per_month_query = """WITH cte AS ( SELECT EXTRACT(MONTH FROM trip_start_timestamp) AS month FROM `bigquery-public-data.chicago_taxi_trips.taxi_trips` WHERE EXTRACT(YEAR FROM trip_start_timestamp) = 2017 ) SELECT month, COUNT(1) AS num_trips FROM cte GROUP BY month ORDER BY month """ rides_per_year_query = """WITH cte AS ( SELECT EXTRACT(YEAR FROM trip_start_timestamp) AS year FROM `bigq..