Home > database >  Mysql 5.6 how regular expressions of replacement?
Mysql 5.6 how regular expressions of replacement?

Time:09-19

Such as I have an address field content " field like this, I'd like to have these irregular address is revised as "no.3, 1-1-1," "no.3, 10-12-11" style. Inside the program I can use the ". * * * (\ d) - (\ d *) - (\ d *) "=& gt;" No.3 $1 - $2 - $3 " this way to replace. How to use inside the mysql query achieve similar to replace?

CodePudding user response:

I think can check out again to save, when if set up, implement the first parameter, otherwise output itself and a field for the address, and table called dz
No.3. Select the if (address regexp '. * * * (\ d) - (\ d *) - (\ d *) ', 'no.3 $1 - $2 - $3', address) from dz
  • Related