MySQL Forums
Forum List  »  Newbie

How to Replace a word
Posted by: Klaus Gebhardt
Date: July 01, 2013 10:26PM

I need a MySQL-statement to replace a specified word in a column.
Example: One record holds the sentence
"An auditor drives an audi."

The statement should replace the audi at the end of the sentence but not the auditor.
My current workaround is that I replace words only when surrounded by spaces, but this does not work in the above sentence, obviously.

I am familiar with the RLIKE/REGEXP statement and it works good for showing records with words, which needs to be replaced.
But I have no clue, how to combine both.

If there is no easy way, maybe somebody has already solved the problem with a PHP-procedure?
Thanks
Klaus

Options: ReplyQuote


Subject
Written By
Posted
How to Replace a word
July 01, 2013 10:26PM
July 03, 2013 07:22PM
July 03, 2013 11:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.