← Back to team overview

maria-discuss team mailing list archive

New Question: Use of UPDATE & SELECT operators



A new question has been asked in "MariaDB Documentation" by jon_lethbridge_g. Please answer it at http://mariadb.com/kb/en/use-of-update-select-operators/ as the person asking the question may not be subscribed to the mailing list.

Hi - I'm sure this has been asked before but I've tried looking!

It's been 20 years since I last used SQL (DB2 and an IBM Mainframe), but all I'm trying to do is change a string of text within a cell.

Background - I'm just changing URL address on a wordpress related DB.

So in MYSQL it's
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.example.com', 'http://localhost/test-site');

Using MariaDB syntax I've tried:
UPDATE `wp_posts` SET `post_content`= REPLACE (`post_content`,'http://www.holidaycottagesloirevalley.com','http://localhost/hclv');
and after some reading I've tried
REPLACE INTO `wp_posts` VALUE ('http://www.holidaycottagesloirevalley.com','http://localhost/hclv');

No joy and I've run out of ideas (strength!)

Can anyone point me in the right direction please?

Thanks in advance,



To view or answer this question please visit: http://mariadb.com/kb/en/use-of-update-select-operators/