views:

932

answers:

1

I think is is simple, but I'm not getting it. 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 pass?

Thanks.

+5  A: 

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

UPDATE TestTable SET description = 'desc of ' || name;
Ben S
+ is not standard SQL syntax for string concatenation.
Ned Batchelder
Is there a standard SQL Syntax for string concatenation? It seems every DB uses a different one. MySQL Uses Concat() function, SQL Lite using ||, SQL Server Uses +. Definitely something that should be standardized.
Kibbee