From e859e4dee0609c530c4f66ea0d6dbdc75f26d229 Mon Sep 17 00:00:00 2001 From: anthonydb Date: Sat, 29 Aug 2020 15:21:22 -0400 Subject: [PATCH] Chapter 6 minor formatting --- Chapter_06/Chapter_06.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chapter_06/Chapter_06.sql b/Chapter_06/Chapter_06.sql index ac542d2..c52b2e9 100644 --- a/Chapter_06/Chapter_06.sql +++ b/Chapter_06/Chapter_06.sql @@ -143,19 +143,19 @@ FROM us_counties_pop_est_2019; -- Extra: -- quintiles -SELECT percentile_cont(array[.2,.4,.6,.8]) +SELECT percentile_cont(ARRAY[.2,.4,.6,.8]) WITHIN GROUP (ORDER BY pop_est_2019) AS quintiles FROM us_counties_pop_est_2019; -- deciles -SELECT percentile_cont(array[.1,.2,.3,.4,.5,.6,.7,.8,.9]) +SELECT percentile_cont(ARRAY[.1,.2,.3,.4,.5,.6,.7,.8,.9]) WITHIN GROUP (ORDER BY pop_est_2019) AS deciles FROM us_counties_pop_est_2019; -- Listing 6-13: Using unnest() to turn an array into rows SELECT unnest( - percentile_cont(array[.25,.5,.75]) + percentile_cont(ARRAY[.25,.5,.75]) WITHIN GROUP (ORDER BY pop_est_2019) ) AS quartiles FROM us_counties_pop_est_2019;