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