Concatenation of strings
You can concatenate strings by using the CONCAT operator or the CONCAT built-in function.
When the operands of two strings are concatenated, the result of the expression is a string. The operands of concatenation must be compatible strings.
For example, consider the following query:
SELECT LASTNAME CONCAT ',' CONCAT FIRSTNME
FROM EMP;
This SELECT statement concatenates the last name, a comma, and the first name of each result row. The result table looks like this:
================
HAAS,CHRISTINE
THOMPSON,MICHAEL
KWAN,SALLY
STERN,IRVING
⋮
Alternative syntax for the SELECT statement shown above is as follows:
SELECT CONCAT(CONCAT(LASTNAME,','),FIRSTNME)
FROM EMP;
In this case, the SELECT statement concatenates a comma to the last name, and then concatenates the first name to the result of the first concatenation.