The general syntax of using the concatenate operators in SQLite is: SELECT "string1" || " " || "string2"; The explanation of this syntax is: Use the SELECT clause to retrieve the data.
One way to concatenate multiple strings or columns is to use the "+" operator. For the rows where MiddleName is NULL, the concatenation result will be NULL.
SQLite substr() returns the specified number of characters from a particular position of a given string. A string from which a substring is to be returned. An integer indicating a string position within the string X. An integer indicating a number of characters to be returned.
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.
The ||
operator is the concatenation in SQLite. Use this code:
select locationname || '<p>' from location;
For comparison,
SQLite || Oracle CONCAT(string1, string2) or || MySQL CONCAT(string1, string2, string3...) or || if PIPES_AS_CONCAT enabled Postgres CONCAT(string1, string2, string3...) or || Microsoft SQL Server 2012+ CONCAT(string1, string2, string3...) or + Microsoft Access +
for Visual Studio 2010, using the Data Sources designer or wizard, you're in trouble using || operator. Create a view in the sqlite db and create your data source(s) from that.
See also this thread.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With