Advertisement
Pandaaaa906

Untitled

May 5th, 2023
1,270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- UPDATE t_sup_inq_order_detail
  2. -- SET prod_info = tmp.new_prod_info
  3. -- FROM (
  4. --
  5. SELECT
  6. sup_inq_d.id,
  7. sup_inq_d.create_time,
  8. inq_d.specs,
  9. substring(inq_d.specs, '([muμMKk]?[GLgl])$'::text) inq_unit,
  10. sup_inq_d.prod_info::jsonb -> 'target' ->> 'spec' supp_target_package,
  11. sup_inq_d.prod_info::jsonb -> 'offer' ->> 'spec' supp_offer_package,
  12. sup_inq_d.prod_info,
  13. replace(sup_inq_d.prod_info, E'undefined\"', substring(inq_d.specs, '([muμMKk]?[GLgl])$'::text) || E'\"') new_prod_info
  14. FROM "t_sup_inq_order_detail" sup_inq_d
  15.  
  16. LEFT JOIN t_inq_order_detail inq_d
  17. ON inq_d.id = sup_inq_d.inq_order_detail_id
  18.  
  19. WHERE prod_info like '%undefined%'
  20. -- ) tmp
  21. -- where tmp.id = t_sup_inq_order_detail.id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement