[英]update row without rewriting the data mysql query correct syntax
I have the following and it is generating errors我有以下内容,它正在生成错误
SELECT * (CONCAT('asd, ') as userHiddenSomeId)
FROM users
How the query should look like to append data inside the userHiddenSomeId
rows?在
userHiddenSomeId
行中追加数据的查询应该是什么样的?
Your error is caused by a wron sintax您的错误是由错误的语法引起的
assuming you want add the prefix asd the column my_column you concat should be假设你想添加前缀 asd 你连接的列 my_column
SELECT *, CONCAT('asd', my_column ) as userHiddenSomeId
FROM users
for the update assuming you want update the column userHiddenSomeId adding a prefix to the previous value then you nedd the prefix asd the the column my_column you concat should be对于更新,假设您要更新列 userHiddenSomeId 向前一个值添加前缀,然后您将前缀添加为您连接的列 my_column
Update user
set userHiddenSomeId = CONCAT('asd', userHiddenSomeId )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.