CONCAT

The CONCAT function combines two arguments.

Read syntax diagramSkip visual syntax diagramCONCAT (expression-1,expression-2)

The arguments must be compatible. For more information about data type compatibility, see Assignments and comparisons.

expression-1
An expression that returns a value of any built-in numeric, datetime, string, Start of changeor BooleanEnd of change data type. A numeric, datetime, Start of changeor BooleanEnd of change argument is cast to a character string before evaluating the function. For more information about converting numeric, datetime, Start of changeand BooleanEnd of change to a character string, see VARCHAR.
expression-2
An expression that returns a value of any built-in numeric, datetime, string, Start of changeor BooleanEnd of change data type. A numeric, datetime, Start of changeor BooleanEnd of change argument is cast to a character string before evaluating the function. For more information about converting numeric, datetime, Start of changeand BooleanEnd of change to a character string, see VARCHAR.

The result of the function is a string that consists of the first argument string followed by the second. The data type of the result is determined by the data types of the arguments. For more information, see With the concatenation operator. If either argument can be null, the result can be null; if either argument is null, the result is the null value.

Note

Syntax alternatives: The CONCAT function is identical to the CONCAT operator. For more information, see With the concatenation operator.

Example

  • Concatenate the column FIRSTNME with the column LASTNAME.
      SELECT CONCAT(FIRSTNME, LASTNAME)
        FROM EMPLOYEE
        WHERE EMPNO ='000010'
    Returns the value 'CHRISTINEHAAS'.