Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add text to a field with sql query

Tags:

I have a field in the mysql database and I would like to insert text in front of all the values in that field.

I would like to add "F21 - " So the field would be "F21 - product name" instead of "product name"

I need a simple sql query

any ideas?

like image 929
Ivar Avatar asked Feb 24 '11 16:02

Ivar


1 Answers

Use concat. Something like this:

update mytable set myfield = concat('f21 -',myfield) 
like image 150
UltraInstinct Avatar answered Sep 23 '22 02:09

UltraInstinct