i need to replace only the domain of an URL present in many rows of a database with a different one. For example, the current URLs are something like www.myoldsite.com/index?s=something and i need to replace only the domain so they will look like www.mynewsite.com/index?s=something and so on. Is it even possible to do that in mysql?
I know how to update and set full values for all rows in a table having certain value but not only part of them with this:
UPDATE `mydatabase`.`mytable` SET `mycolumn` = 'http://mynewsite.com/' WHERE `mycolumn` = 'http://myoldsite.com/';
What can i do in this case?
Thank you.