Concatenation operator

Besides the concat() function, SQLite provides the concatenation operator (||) to join two strings into one string.

Syntax

s1 || s2
s1 || s2 || s3

Example

SELECT
    FirstName || ' ' || LastName AS FullName
FROM
    Employees
ORDER BY
    FullName;

Output of sql example

FullName
----------------
Andrew Adams
Jane Peacock
Laura Callahan
Margaret Park
Michael Mitchell
Nancy Edwards
Robert King
Steve Johnson
SELECT
  first_name || ' ' || last_name AS full_name,
  street || ' ' || city || ', ' || state || ' ' || zip AS address  
FROM customers;
SELECT 
    id, first_name, last_name, salary, first_name || 100 || ' has id ' || id AS new
FROM 
    myTable;

ID FIRST_NAME LAST_NAME SALARY NEW 1 Rajat Rawat 10000 Rajat100 has id 1 2 Geeks ForGeeks 20000 Geeks100 has id 2 3 Shane Watson 50000 Shane100 has id 3 4 Kedar Jadhav 90000 Kedar100 has id 4