SQLite Update Syntax for string concatenation?

蓝咒 提交于 2019-12-03 15:09:36

问题


I have a table with this data

id , name    , description
1  , apple   , ''
2  , orange  , ''

I am trying to pass the following statement to update the row so the description column is 'desc of apple' and 'desc of orange' but it is not working.

 Update TestTable Set description = 'desc of ' + name 

What is the proper syntax to concatenate strings?


回答1:


SQLite's string concatenation operator is "||", not "+"

UPDATE TestTable SET description = 'desc of ' || name;


来源:https://stackoverflow.com/questions/1446125/sqlite-update-syntax-for-string-concatenation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!