The realization method of replacing letters in mysql database
This article mainly introduces the realization method of replacing letters in mysql database, which has certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
In mysql, you can use the replace function to replace letters, with syntax such as "mysql > UPDATE `de` SET body = REPLACE (body,','');".
Mysql replacement string
The replace function in mysql directly replaces a specific string in a field in the mysql database, and no longer needs to write its own function to replace it, which is very convenient to use. Mysql replacement function replace ()
UPDATE table_name SET field_name = REPLACE (field_name, 'from_str',' to_str')
Description:
Table_name-the name of the watch
Field_name-Field name
From_str-- string to be replaced
To_str-- replaced by a string
For example:
Mysql > UPDATE `dede` SET body = REPLACE (body,',')
This function is multi-byte safe, which means you don't have to worry about Chinese or English characters.
Thank you for reading this article carefully. I hope it will be helpful for everyone to share the method of replacing letters in the mysql database. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!