开发者

Add text to a field with sql query

开发者 https://www.devze.com 2023-02-13 09:42 出处:网络
I have a开发者_JS百科 field in the mysql database and I would like to insert text in front of all the values in that field.

I have a开发者_JS百科 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?


Use CONCAT. Something like this:

UPDATE mytable SET myfield = CONCAT('f21 -', myfield)
0

精彩评论

暂无评论...
验证码 换一张
取 消