From c817174978350059248d11fce75b0b261e5e8f49 Mon Sep 17 00:00:00 2001 From: anthonydb Date: Thu, 20 May 2021 09:05:59 -0400 Subject: [PATCH] Chapter 13 revisions per tech review --- Chapter_13/Chapter_13.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Chapter_13/Chapter_13.sql b/Chapter_13/Chapter_13.sql index 9f121c5..67738d1 100644 --- a/Chapter_13/Chapter_13.sql +++ b/Chapter_13/Chapter_13.sql @@ -295,7 +295,7 @@ WITH (FORMAT CSV, HEADER); SELECT * FROM crosstab('SELECT station_name, - date_part($$month$$, observation_date), + date_part(''month'', observation_date), percentile_cont(.5) WITHIN GROUP (ORDER BY max_temp) FROM temperature_readings @@ -332,7 +332,8 @@ SELECT max_temp, WHEN max_temp < 20 THEN 'Inhumane' ELSE 'No reading' END AS temperature_group -FROM temperature_readings; +FROM temperature_readings +ORDER BY station_name, observation_date; -- Listing 13-21: Using CASE in a Common Table Expression