update part of a string in mysql

Solutions on MaxInterview for update part of a string in mysql by the best coders in the world

showing results for - "update part of a string in mysql"
Neele
26 Jan 2017
1UPDATE table
2SET field = REPLACE(field, 'string', 'anothervalue')
3WHERE field LIKE '%string%';
Alessandro
08 Jul 2019
1SELECT Country, REPLACE(Country, 'States', 'Kingdom') 
2FROM Persons;
3
4UPDATE tableName
5SET Country = REPLACE(Country, 'States', 'Kingdom')
6
7-- if Country = 'United States'
8-- After replace = 'United Kingdom'