Advertisement
Pandaaaa906

Untitled

Aug 15th, 2022
1,133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. SELECT
  3. brand,
  4. cat_no,
  5. info3 remark,
  6. case
  7. when info3 ~ '\|'
  8. then trim(substring(info3 from '([^\|]+)'))
  9. else null
  10. end purity,
  11. case
  12. when info3 ~* '/kit' and info3 ~ '\|'
  13. then regexp_replace(substring(info3 from '(?<=\|) ?(.+)'), '(?<=\d) ', '')
  14. when info3 ~ '\|'
  15. then regexp_replace(substring(info3 from '(?<=\|) ?([^/]+)'), '(?<=\d) ', '')
  16.  
  17. when info3 ~ '\d ?x ?\d'
  18. then regexp_replace(info3, '\D*(\d+) ?x ?(\d+(\.\d+)?) ?([mMuUμkK]?[gGlL]).*', '\1x\2\4')
  19.  
  20. when info3 ~* 'kit'
  21. then replace(info3, 'Analytical Standard', '')
  22. -- when info3 ~ 'Certified Reference Material'
  23. -- then null
  24. else regexp_replace(info3, '\D*(\d+(\.\d+)?) ?([mMuUμkK]?[gGlL]).*', '\1\3')
  25. -- regexp_replace(regexp_replace(regexp_replace(info3,'/[支套]',''), '(?<=\d) ', ''),'^approx ','')
  26. end package,
  27. '瓶' unit_name,
  28. -- info4,
  29. substring(replace(info4, ',', '') from '(\d+(\.\d+)?)')::float orig_cost,
  30. 'USD' currency,
  31. stock_info delivery,
  32. create_date created_at,
  33. modify_date modified_at,
  34. 'SYSTEM' modified_by
  35. FROM public.rawdata
  36. WHERE brand = 'cerilliant'
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement