From a4bb6851b2ea618130eda8fd91bab0cc8e2e590c Mon Sep 17 00:00:00 2001 From: anthonydb Date: Thu, 2 Sep 2021 17:08:11 -0400 Subject: [PATCH] Chapter 17 edits --- Chapter_17/Chapter_17.sql | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Chapter_17/Chapter_17.sql b/Chapter_17/Chapter_17.sql index 6e5243c..9bb6a0d 100644 --- a/Chapter_17/Chapter_17.sql +++ b/Chapter_17/Chapter_17.sql @@ -138,11 +138,9 @@ percent_change(new_value numeric, old_value numeric, decimal_places integer DEFAULT 1) RETURNS numeric AS -$$ - SELECT round( - ((new_value - old_value) / old_value) * 100, decimal_places - ); -$$ +'SELECT round( + ((new_value - old_value) / old_value) * 100, decimal_places +);' LANGUAGE SQL IMMUTABLE RETURNS NULL ON NULL INPUT; @@ -151,7 +149,7 @@ RETURNS NULL ON NULL INPUT; SELECT percent_change(110, 108, 2); --- Listing 17-13: Testing percent_change() on Census data +-- Listing 17-13: Testing percent_change() on census data SELECT c2019.county_name, c2019.state_name,