views:

85

answers:

2

I am trying to execute a SQlite replace function, but use another field in the function.

select  locationname + '<p>' from location;

In this snip, the result is a list of 0s. I would have expected a string with the text from locationname and the '<p>' literals.

+5  A: 

Try using || in place of +

select  locationname || '<p>' from location;

From SQLite documentation:

The || operator is "concatenate" - it joins together the two strings of its operands.

codaddict
+1: You were first
OMG Ponies
+3  A: 

The || operator is the concatenation in SQLite. Use this code:

select  locationname || '<p>' from location;
shamittomar
OMG Ponies