简体   繁体   中英

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?

Your error is caused by a wron sintax

assuming you want add the prefix asd the column my_column you concat should be

  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

  Update  user 
  set  userHiddenSomeId = CONCAT('asd',  userHiddenSomeId  )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM