Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLite Update Syntax for string concatenation?

Tags:

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?

like image 722
Snowy Avatar asked Sep 18 '09 18:09

Snowy


1 Answers

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

UPDATE TestTable SET description = 'desc of ' || name; 
like image 186
Ben S Avatar answered Sep 28 '22 17:09

Ben S