×
×
MySQL search and replace some text in a field

MySQL search and replace some text in a field
Published Sep 07,2022 by Kailash Singh
0 Comment 1081 Views
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');
Comments ( 0 )
Elevenstech Web Tutorials
Elevenstech Web Tutorials helps you learn coding skills and enhance your skills you want.
As part of Elevenstech's Blog, Elevenstech Web Tutorials contributes to our mission of “helping people learn coding online”.
Read More
Newsletter
Subscribe to get the latest updates from Elevenstech Web Tutorials and stay up to date
Copyright 2018 - 2025 Elevenstech Web Tutorials All rights reserved.