regex - Use regular expressions to edit an entire column with MySQL -
i have table so:
| link | ---------- http://dev.site.com/images/image1.png http://dev.site.com/images/image2.png http://dev.site.com/images/image3.png http://dev.site.com/images/image4.png
but, need change contains:
| link | ---------- http://site.com/resources/images/image1.png http://site.com/resources/images/image2.png http://site.com/resources/images/image3.png http://site.com/resources/images/image4.png
there lots of entries need changing. way go updating of entries?
right i'm using find entries:
select column table link regexp '^dev'
i updating links hand first, there many left. can't update them myself.
any ideas?
you call "field" in table listing "link" in sql i'm going use "field"
update table set field = replace(field, 'dev.site.com', 'site.com/resources') field rlike '^dev.site.com'
Comments
Post a Comment