String Replace

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
leewad
Forum Commoner
Posts: 91
Joined: Tue May 11, 2004 8:32 am

String Replace

Post 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.

User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

I think you should read the String Functions chapter in MySQL documentation -> http://dev.mysql.com/doc/mysql/en/String_functions.html
Post Reply