CONCAT
Descriptionβ
Concatenates multiple strings. Special cases:
- If any of the parameter values ββis NULL, the result returned is NULL
Syntaxβ
CONCAT ( <expr> [ , <expr> ... ] )
Parametersβ
Parameter | Description |
---|---|
<expr> | The strings to be concatenated |
Return valueβ
Parameter list <expr>
The strings to be concatenated. Special cases:
- If any of the parameter values ββis NULL, the result returned is NULL
Exampleβ
SELECT CONCAT("a", "b"),CONCAT("a", "b", "c"),CONCAT("a", null, "c")
+------------------+-----------------------+------------------------+
| concat('a', 'b') | concat('a', 'b', 'c') | concat('a', NULL, 'c') |
+------------------+-----------------------+------------------------+
| ab | abc | NULL |
+------------------+-----------------------+------------------------+