template out necessary function

This commit is contained in:
Trowbridge 2019-03-21 03:23:07 -04:00
parent a8027b8447
commit 7d0166aab2

View File

@ -13,7 +13,7 @@ target AS (select $${"scenario":{"quota_rep_descr":"10032 - BRYAN HILL","part_gr
JOIN LATERAL json_each(def->'months') je ON true
JOIN LATERAL json_to_record(je.value) as r (amount numeric, qty numeric) ON TRUE
)
select * from newm
--select * from newm
,GLD AS (
SELECT
N1COMP COMP
@ -135,7 +135,13 @@ select * from newm
FROM
mmix
)
select * from mmixp
SELECT
t.*
,x.*
FROM
newm t
--need to build this function
JOIN LATERAL get_closest(pick_from_json) x ON true
,closest AS (
SELECT