MySQL Forums
Forum List  »  Newbie

Re: How to find and replace text for all occurences in a colomn..
Posted by: Chris Stubben
Date: March 24, 2005 03:38PM

Hi,

Before doing a search and replace, I usually run this SELECT to see what I'm changing.


select data, REPLACE( data, 'titi', 'tutu' ) as change_to from data where data like '%titi%';


I also include the like clause in my update statement... Not required though.


UPDATE toto SET data = REPLACE( data, 'titi', 'tutu' ) where data like '%titi%';



Chris

Options: ReplyQuote


Subject
Written By
Posted
Re: How to find and replace text for all occurences in a colomn..
March 24, 2005 03:38PM


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.