Examples of Oracle regular expressions used in conjunction with translate

This example demonstrates the critical information you want to extract from the Description field, below the target number of periods to extract information on the same field.

select distinct  b.machdt || substr(lpad(trantm, 9, '0'), 1, 6) trantm,
                 custac,
                 trim(translate(regexp_substr(remark, '((-))[A-Z0-9]+'),
                                '-]',
                                ' ')) subjcd,
                 trim(translate(regexp_substr(remark, '(第)[A-Z0-9]+(期)'),
                                '第期',
                                ' ')) qishu
            from cbmain_user.my_table b
           where machdt > '20190201' 
 

 

 

Guess you like

Origin www.cnblogs.com/kevinlucky/p/11621326.html