SQL replace text in column

UPDATE table SET column = replace(column, 'text', 'replacement');

Or replace only where column data is currently set to x or y:

UPDATE table SET column = replace(column, 'text', 'replacement') WHERE column = 'x' OR column = 'y';

Leave a Reply

Your email address will not be published.