How to remove an unwanted multiple character (e.g. &,%, @) from database records

I have a problem removing a few unwanted characters in a MySql database as too large. Is there access to the script to remove this character?

Example of a record with several characters: -

[]No. 11, Persiaran Bukit [] Satu&[]Taman @Sri %Nibong 
+4
source share
2 answers

use the REPLACE function.

 UPDATE tablename SET ColName = REPLACE(REPLACE(REPLACE(Colname, '&', ''), '@', ''), '%', '') 
+1
source

I suggest here to prepare a table containing all possible unwanted characters, and then process them in a single select request using the replace function.

+1
source

Source: https://habr.com/ru/post/1441757/


All Articles