CityofToronto / bdit_king_pilot_dashboard

Dashboard for King St Pilot
GNU General Public License v3.0
4 stars 2 forks source link

Update king_pilot.date_lookup table for 2019 #131

Closed radumas closed 5 years ago

radumas commented 5 years ago
INSERT INTO king_pilot.date_lookup
SELECT dt::DATE, CASE WHEN EXTRACT('isodow' FROM dt)::INT < 6 THEN 'Weekday' ELSE 'Weekend' END , CASE WHEN holiday IS NOT NULL THEN 'Excluded' ELSE 'Pilot' END 
FROM generate_series('2019-01-01'::DATE, '2019-12-31'::DATE, INTERVAL '1 Day') dates(dt)
LEFT OUTER JOIN ref.holiday USING(dt)