Home > database >  A regexp_replace SQL for help
A regexp_replace SQL for help

Time:10-12

As shown in figure, bankdocname field before good without norms, and construction bank have write "China construction bank, construction bank,,,, China construction bank," and now need to be unified change "China construction bank co., LTD."
This rule is built "* *", built with and done, no matter what's between the front and, direct replacement for "China construction bank co., LTD." to go
Know regexp_replace function yesterday, I try to write regexp_replace (bankdocname, line built '* *', 'China construction bank co., LTD.), to
Ask ace

CodePudding user response:

Regexp_replace (bankdocname, '^. *. * line $',' China construction bank co., LTD.)
Or directly use the where + like '% % build line'

CodePudding user response:


Not do

CodePudding user response:

 select regexp_replace (' dasd adasd build 1 ', '(^. *. * $) | | (^. *. * $) (^. *. *. * $)', 'name') from dual; 

CodePudding user response:

refer to the second floor sumsen response:

Not do

If include building and lines, not on line at the end of all want to?

Regexp_replace (bankdocname, '^. *. *. * $',' China construction bank co., LTD.)
Or directly use the where + like 'built line % % %'

CodePudding user response:

Don't want to use this, use the first line as segmentation, the previous spell in China construction bank, back to back

CodePudding user response:


The update table_
The set bankdocname='China construction bank co., LTD. | | substr (bankdocname, instr (bankdocname,' line ', 1) + 1)
  • Related