How to write a SQL to replace strings in a column in a MySQL database table?

How to replace strings in a column in a MySQL database table? For example, I would like to replace http://www.systutorials.com with https://www.systutorials.com in a content column of a table post.

You may use a SQL statement as follows.

update post
set content = replace(content, 'http://www.systutorials.com', 'https://www.systutorials.com')
where content like '%http://www.systutorials.com%'

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *