MySQL search and replace some text in a field Share
In this tutorial, we are going to teach. How to Search and Replace some text in a field using MySQL.
Definition and Usage
The REPLACE() function replaces all occurrences of a substring within a string, with a new substring.
Note: This function performs a case-sensitive replacement.
Syntax:
UPDATE table_name SET field = replace(field, 'string-to-find', 'string-that-will-replace-it');
Example:
UPDATE fruit SET fruit_name = replace(fruit_name, 'appel', 'apple');
![Unknown Collation [FIXED] : utf8mb4_0900_ai_ci In MYSQL](https://elevenstechwebtutorials.com/assets/content/1673553215.png)




Click to Join









Comments 0