Date parts
The date_part() function is useful when you want to aggregate data by a unit of time across multiple larger units of time. For example, aggregating data by month across different years, or aggregating by hour across different days.
Recall that you use date_part() as:
SELECT date_part('field', timestamp);
In this exercise, you'll use date_part() to gain insights about when Evanston 311 requests are submitted and completed.
Bu egzersiz
Exploratory Data Analysis in SQL
kursunun bir parçasıdırUygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
-- Extract the month from date_created and count requests
SELECT ___ AS month,
___
FROM evanston311
-- Limit the date range
WHERE ___
AND ___
-- Group by what to get monthly counts?
GROUP BY ___;