Forum Moderators: coopster

Message Too Old, No Replies

sql find and replace in database

sql find and replace a phrase in a database

         

weddingm

10:20 pm on Jun 21, 2008 (gmt 0)

10+ Year Member



Hello all,

Does anyone know how to find and repleace in a data base?
1) It's all in one field.
2) I need to find and replace a phrase within an array seperated by commas
ie) me, you, him, her....change to me, us, him, her

I was thinking somethink like:

Select * from 'table' where column LIKE '%you%' replace 'you' with us;

Thanks,
Matt

dreamcatcher

11:39 pm on Jun 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SELECT REPLACE [dev.mysql.com](column, 'you', 'us')....

dc

HandyBiteSize

8:58 am on Jun 23, 2008 (gmt 0)

10+ Year Member



UPDATE table SET column = REPLACE(column,'you','us>');