From fee1b9202f533f37b78c68709781f4e9a7abf7db Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 13 Apr 2021 16:15:11 -0400 Subject: [PATCH] trim white space off part numbers --- route_sql/swap_post.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/route_sql/swap_post.sql b/route_sql/swap_post.sql index 3f66b70..4e79d0b 100644 --- a/route_sql/swap_post.sql +++ b/route_sql/swap_post.sql @@ -2,7 +2,11 @@ WITH target AS (SELECT $$swap_doc$$::jsonb swap) ,pl AS ( SELECT - x.* + -----trim white space on CMS part numbers coming from spreadsheet master data---- + rtrim(x.original) AS original + ,sales + ,rtrim(x."replace") AS replace + ,rtrim(x.fit) fit FROM TARGET LEFT JOIN LATERAL jsonb_to_recordset(target.swap->'rows') AS x(original text, sales numeric, replace text, fit text)ON TRUE