From e7f7cf40c6ed07f5558ce936d56af21c098e42a3 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 8 Nov 2023 12:46:11 -0500 Subject: [PATCH] vault backup: 2023-11-08 12:46:11 --- sql/dev.sql | 60 ----------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 sql/dev.sql diff --git a/sql/dev.sql b/sql/dev.sql deleted file mode 100644 index 448fa8c..0000000 --- a/sql/dev.sql +++ /dev/null @@ -1,60 +0,0 @@ -------------real history on target scenario------------ -WITH -partcodes AS ( - SELECT - item - ,'v1:' || COALESCE(i.coltier,'') || '.' || COALESCE(substring(i.branding,1,1),'') || '.' || coalesce(i.uomp,'') || '.' || coalesce(i.suffix,'') || '.' || coalesce(i.accs_ps,'') v1dataseg - ,_ds.dataseg v0dataseg - ,part_group - FROM - "CMS.CUSLG".itemm i - LEFT OUTER JOIN rlarp.molds m ON - m.stlc = i.stlc - LEFT OUTER JOIN _ds ON - _ds.colgrp = i.colgrp - AND _ds.brand = i.branding - WHERE - i.item ~ 'TUH1000' - AND part_group IS NOT NULL -) -,custs AS ( - SELECT - dba - FROM - rlarp.cust c - WHERE - c.dba ~ 'DIAMOND ' -) -,allscenarios AS ( - SELECT DISTINCT - jsonb_build_object('mold',part_group,'cust',dba) sc - FROM - partcodes - CROSS JOIN custs -) -,v1scenarios AS ( - SELECT DISTINCT - jsonb_build_object('mold',part_group,'cust',dba,'v1dataseg',v1dataseg) sc - FROM - partcodes - CROSS JOIN custs -) -,v0scenarios AS ( - SELECT DISTINCT - jsonb_build_object('mold',part_group,'cust',dba,'v0dataseg',v0dataseg) sc - FROM - partcodes - CROSS JOIN custs -) -,hist AS ( - SELECT - s.sc - ,p.gset - ,(SELECT string_agg(substring(ok,1,2),'') FROM (SELECT * FROM jsonb_object_keys(p.gset) jok(ok)) x ) - ,p.season - FROM - allscenarios s - LEFT OUTER JOIN rlarp.price_pool_dev p ON - p.gset @> s.sc -) -SELECT * FROM hist