Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- UPDATE t_sup_inq_order_detail
- -- SET prod_info = tmp.new_prod_info
- -- FROM (
- --
- SELECT
- sup_inq_d.id,
- sup_inq_d.create_time,
- inq_d.specs,
- substring(inq_d.specs, '([muμMKk]?[GLgl])$'::text) inq_unit,
- sup_inq_d.prod_info::jsonb -> 'target' ->> 'spec' supp_target_package,
- sup_inq_d.prod_info::jsonb -> 'offer' ->> 'spec' supp_offer_package,
- sup_inq_d.prod_info,
- replace(sup_inq_d.prod_info, E'undefined\"', substring(inq_d.specs, '([muμMKk]?[GLgl])$'::text) || E'\"') new_prod_info
- FROM "t_sup_inq_order_detail" sup_inq_d
- LEFT JOIN t_inq_order_detail inq_d
- ON inq_d.id = sup_inq_d.inq_order_detail_id
- WHERE prod_info like '%undefined%'
- -- ) tmp
- -- where tmp.id = t_sup_inq_order_detail.id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement