I have a field in the mysql database and I would like to insert text in front of all the values in that field.
我在mysql数据库中有一个字段,我想在该字段中的所有值前面插入文本。
I would like to add "F21 - " So the field would be "F21 - product name" instead of "product name"
我想添加“F21 - ”所以该字段将是“F21 - 产品名称”而不是“产品名称”
I need a simple sql query
我需要一个简单的SQL查询
any ideas?
有任何想法吗?
1 个解决方案
#1
46
Use concat. Something like this:
使用concat。像这样的东西:
update mytable set myfield = concat('f21 -',myfield)
#1
46
Use concat. Something like this:
使用concat。像这样的东西:
update mytable set myfield = concat('f21 -',myfield)