hello;
I have the_table:
col_1 , col_2
-------------------------
aaa , aaa_do aaa_dat
the query that I am using:"update the_table set col_2=replace(col_2,col_1,concat('hoorah_' , col_1) ) "
I want
col_1 , col_2
-------------------------
aaa , hoorah_aaa_do hoorah_aaa_dat
however the query does not successfully stick the 'hoorah_' in front of the aaa_dat; instead I get this:
col_1 , col_2
-------------------------
aaa , hoorah_aaa_do aaa_dat
any thoughts?
thanks
Shannon Burnett
Asheville NC USA
[SOLVED] mysql: nesting a 'concat' within a 'replace'
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
UPDATE table_name SET column2 = REPLACE (column2 , column1 , CONCAT( 'hoorah_', column1 ))