我有一列包含 url (id, url):
http://www.example.com/articles/updates/43
http://www.example.com/articles/updates/866
http://www.example.com/articles/updates/323
http://www.example.com/articles/updates/seo-url
http://www.example.com/articles/updates/4?something=test
我想把“更新”这个词改成“新闻”。可以用脚本来做到这一点吗?
UPDATE your_table
SET your_field = REPLACE(your_field, 'articles/updates/', 'articles/news/')
WHERE your_field LIKE '%articles/updates/%'
现在的行就像
http://www.example.com/articles/updates/43
will be
http://www.example.com/articles/news/43
http://www.electrictoolbox.com/mysql-find-replace-text/ http://www.electrictoolbox.com/mysql-find-replace-text/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)