How to remove certain text from each field in a specific column? (SQL Query)

Ranjeet_8
Posted by Ranjeet_8 under Sql Server category on | Points: 40 | Views : 1245
Remove certain text from each field in a specific column (SQL Query)
For eg: -
In a table, you want to remove certain text from each field in a specific column (Column_Name).
--------------------------------
ID Column_Name
--------------------------------
1 Aakash123
2 Raj123
3 Samir123
4 Rakesh123

UPDATE Table_Name
SET Column_Name = REPLACE(Column_Name, '123', '')

OUTPUT will be
--------------------------------
ID Column_Name
--------------------------------
1 Aakash
2 Raj
3 Samir
4 Rakesh

Comments or Responses

Login to post response