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
「更新」という単語を「ニュース」に変更したいのですが、スクリプトでこれを行うことは可能ですか?
ベストアンサー1
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
だろう
http://www.example.com/articles/news/43