I have a table named Employee which has following columns and values.
ID FNAME LNAME CITY
1 Shahriar Ahmed Dhaka
2 Mamunur Rashid Natore, Rajshahi
3 Muntasir Shafiq Bogra, Rajshahi
You can use REPLACE function as it searches for certain characters in a string and replaces them with other characters.Furtermore, you could use CASE expression to fulfill differnt condition of replacement.
UPDATE Employee SET CITY = (CASE WHEN FNAME = 'Mamunur' AND LNAME = 'Rashid' THEN REPLACE(city, 'Rajshahi', 'Northern Rajshahi') WHEN FNAME = 'Muntasir' AND LNAME = 'Shafiq' THEN REPLACE(city, 'Rajshahi', 'Southern Rajshahi') ELSE CITY END );
For further study go on,