How to use the replace function in mysql
This article mainly explains "how to use the replace function in mysql". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use the replace function in mysql".
Description
1, you can replace the contents of the string, directly replace a specific string in a field in the database, no longer need to write their own function to replace.
It is a common function in mysql to deal with strings.
2. It is used to replace all from_str in the string str with to_str, and return the replaced string.
Example
SELECT REPLACE ('MySQL string function', 'string', 'date') AS str1, REPLACE ('MySQL string function', 'string',') AS str2 Str1 | str2 |-+-+ MySQL date function | MySQL function | Thank you for reading. The above is the content of "how to use the replace function in mysql". After the study of this article, I believe you have a deeper understanding of how to use the replace function in mysql, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!