We know that the data can be changed inside a field by using update command.
In this article I will guide you to replace part of the data without changing the entire data of the field. For this we will use replace command to replace a part of the contents in a fields. We will use the following table (Employee) for illustration purpose:
Now we will use replace in query to change the department by using below query.
UPDATE Employee SET Department=REPLACE(Department, 'Tech', 'Technology')
The output of the query will be as below :
We can also use the WHERE clause if we want to do replace for a selected records. For example if we want to do the replace operation for employee Amit , we will use the below query :
UPDATE Employee SET Department=REPLACE(Department, 'Tech', 'Technology') WHERE Name='Amit'