Page 1 of 1

String Replace

Posted: Sun May 16, 2004 12:30 pm
by leewad
Hi

Does anybody know how to change a part string in mysql database?

using:

їcode]update sales
set ID = replace(ID,'from','to')
where 1ї/code]

I am wanting to change the following:

CS119 to 119L
CS221 to 221L

etc etc,

there are over 500 to change and it would take forever to change them manually

Thanks.


Posted: Sun May 16, 2004 3:33 pm
by delorian
I think you should read the String Functions chapter in MySQL documentation -> http://dev.mysql.com/doc/mysql/en/String_functions.html