Example Before:
column x
yummy grains
blah blah
foobar 1
sugar daddy
foobar 2
fiber one
What I want after:
column x
yummy grains
blah blah
gooey foobar 1
sugar daddy
gooey foobar 2
fiber one
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note that this is one query (as evidenced by the last
;).Detailed (not in the syntactically correct order):
UPDATE yourtable– for rows in tableyourtableWHERE column x– for those rows, where in columncolumn x…LIKE '%foobar%'– …there isfoobarsomewhere in the string (note the wildcards at both ends)SET column x=– setcolumn xof the row to the following value:CONCAT('gooey ',column x)– concatenate (add together) the literal string ‘gooey‘ and whatever string was incolumn x.