- Overview
- Data types
- Commands
- Functions
- Overview
- Aggregate
- Conditional expression
- Conversion
- Date and time
- Numeric
- String
- Semi-structured data
On this page
|| (concat)
Concatenates two strings.
The ||
operator provides alternative syntax for CONCAT and can concatenate more than two strings.
Syntax
<expr> || <expr> [ || <expr> ... ]
Arguments
<expr>
The input expressions must all be strings.
Returns
The data type of the returned value is string. If any input value is NULL, returns NULL.
Examples
SELECT 'George Washington ' || 'Carver';
+----------------------------------+
| 'George Washington ' || 'Carver' |
+----------------------------------+
| George Washington Carver |
+----------------------------------+
The concatenation operator can be fluently chained to concatenate multiple strings:
SELECT 'This ' || 'is ' || 'another ' || 'concatenation ' || 'technique.';
+--------------------------------------------------------------------+
| 'This ' || 'is ' || 'another ' || 'concatenation ' || 'technique.' |
+--------------------------------------------------------------------+
| This is another concatenation technique. |
+--------------------------------------------------------------------+