concat, ||
Concatenates two strings.
The ||
operator provides alternative syntax for CONCAT and can concatenate more than two strings.
Syntax
Section titled “Syntax”concat( <expr> , <expr> )<expr> || <expr> [ || <expr> ... ]
Arguments
Section titled “Arguments”<expr>
Section titled “<expr>”The input expressions must all be strings.
Returns
Section titled “Returns”The data type of the returned value is string. If any input value is NULL, returns NULL.
Examples
Section titled “Examples”SELECT concat('George Washington ', 'Carver');
+----------------------------------------+| concat('George Washington ', 'Carver') |+----------------------------------------+| George Washington Carver |+----------------------------------------+
Use the ||
concatenation operator instead of the function:
SELECT 'This ' || 'is ' || 'another ' || 'concatenation ' || 'technique.';
+--------------------------------------------------------------------+| 'This ' || 'is ' || 'another ' || 'concatenation ' || 'technique.' |+--------------------------------------------------------------------+| This is another concatenation technique. |+--------------------------------------------------------------------+