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.

Begin general-use programming interface information.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:

Start of change
SELECT CONCAT(CONCAT(LASTNAME,','),FIRSTNME)
FROM EMP;
End of change

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.

End general-use programming interface information.