Concat 不起作用 phpmyadmin (mysql)
我想更新我的行并连接我的字符串,但此查询有错误
UPDATE FILE SET NOMFIC ='supp_'+D_NOMFIC WHERE IdFile = 2
i want update my row and concat my string but i have an error with this query
UPDATE FILE SET NOMFIC ='supp_'+D_NOMFIC WHERE IdFile = 2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
请参阅 MySQL 文档中的
CONCAT()
函数 此处CONCAT() 基本上将要连接在一起的字符串列表作为其参数。
See the
CONCAT()
function within the MySQL documentation hereCONCAT() basically takes as its parameters a list of strings to be concatenated together.
MySQL 中不能使用 + 连接。使用
CONCAT('supp_, D_NOMFIC)
,因此它变为UPDATE FILE SET NOMFIC = CONCAT('supp_, D_NOMFIC) WHERE IdFile = 2
有关详细信息,请参阅:http://dev.mysql.com/doc/refman/5.0 /en/string-functions.html#function_concat
您可以像这样连接带引号的字符串:
SELECT 'a' 'b' 'c' FROM someTable
。You can't concat with + in MySQL. Use
CONCAT('supp_, D_NOMFIC)
, so it becomesUPDATE FILE SET NOMFIC = CONCAT('supp_, D_NOMFIC) WHERE IdFile = 2
For more info see: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat
You can concat quoted strings like this:
SELECT 'a' 'b' 'c' FROM someTable
though.试试这个:
UPDATE FILE SET NOMFIC = CONCAT('supp_', D_NOMFIC) WHERE IdFile = 2
Try this:
UPDATE FILE SET NOMFIC = CONCAT('supp_', D_NOMFIC) WHERE IdFile = 2
使用
CONCAT
代替:Use
CONCAT
instead:试试这个:
Try this: