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.

asked Jul 20 by anonymous

1 Answer

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%'
answered Aug 3 by Eric Z Ma (42,870 points)

Please log in or register to answer this question.

Related questions

1 answer
asked May 3, 2013 by Peter M. (1,270 points)
1 answer
asked Jul 31, 2013 by EricaS. (210 points)
0 answers
asked Jun 6 by anonymous
Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...