mysql find and 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
aussie_clint
Forum Commoner
Posts: 41
Joined: Mon Jul 31, 2006 9:14 am
Location: Brisbane, Australia
Contact:

mysql find and replace

Post by aussie_clint »

I wanted to convert a excel file to csv so i can import it to mysql but it has comers in it (,) so i replaced them with # and now im trying to run this query in mysql query browser to change them back to a coma

Code: Select all

update `newprice list` set `newprice list`.Description = 
replace([field_name],'[#]','[,]');
Can anyone tell me where im going wrong?

Thanks
Clint
mezise
Forum Newbie
Posts: 17
Joined: Tue Sep 18, 2007 4:38 am

Post by mezise »

Hi Clint,

I think the problem lies in square brackets used in search and replace strings. Following query should work.

Code: Select all

update `newprice list` set `newprice list`.Description =
replace(`newprice list`.Description,'#',',');
Michal
Post Reply