【问题标题】:phpmyadmin add text to a fieldphpmyadmin 将文本添加到字段
【发布时间】:2013-03-14 16:00:37
【问题描述】:
我想将文本 fred 添加到表 products_description 中的 products_head_keywords_tag 字段中,但我不想清除该字段中的其余文本。
以下内容会清除文本并添加 fred,但我只想在该字段中已经存在的其他文本之后添加文本 fred。
UPDATE products_description SET products_head_keywords_tag = "fred"
请帮忙。
【问题讨论】:
标签:
mysql
database
phpmyadmin
field
【解决方案1】:
这在 T-SQL 中起到了作用:
update products_description SET products_head_keywords_tag = convert(nvarchar(max),products_head_keywords_tag) + 'fred'
我猜mysql会处理它非常相似。
编辑:在 MySQL 中 concat() 是要走的路:
UPDATE products_description SET products_head_keywords_tag = CONCAT(products_head_keywords_tag, 'fred')