From 690b325e7806e34f73dea2bbf99804fa0d050686 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 11 Jan 2021 22:37:16 -0500 Subject: [PATCH] more work --- db_schema/extract_for_customer_facing.pg.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db_schema/extract_for_customer_facing.pg.sql b/db_schema/extract_for_customer_facing.pg.sql index 8092ae6..d658da5 100644 --- a/db_schema/extract_for_customer_facing.pg.sql +++ b/db_schema/extract_for_customer_facing.pg.sql @@ -130,7 +130,7 @@ SELECT --retain this column to re-pivot back to original format ,up.col ,up.vol_uom - ,row_number() OVER (PARTITION BY up.stlc, up.coltier, up.branding, up.accs, up.suffix ORDER BY item DESC) seq + ,row_number() OVER (PARTITION BY up.stlc, up.coltier, up.branding, up.accs, up.suffix, up.pckg, up.col, up.vol_uom ORDER BY item DESC) seq ,item FROM unpivot up @@ -167,7 +167,10 @@ FROM items JOIN LATERAL rlarp.uom_array(conv) rslt ON true ) +--missing column 3 --SELECT * FROM unpivot ORDER BY stlc +--SELECT * FROM items_init where seq = 1 +--SELECT * FROM items where seq = 1 ----join conversion back to data initial part link------------------------------ SELECT i.* @@ -181,3 +184,4 @@ WHERE ORDER BY stlc ,coltier + ,col