CONCAT_WS()

Overview

Concatenates and returns the given strings using the specified separator.

USAGE

CONCAT_WS(separator, string[, string] ...)

Argument Name

Description

separator

The separator to add between adjacent strings

string

One or more strings to concatenate

DETAILS

CONCAT_WS() is a string function that returns a string formed by concatenating all the string arguments interposed with the specified separator string.

The function name can be thought of as "concatenate with separator".

The separator is not used if only one string argument is provided.

Non-string arguments are converted into string arguments, when possible.

Any NULL string arguments are skipped.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT CONCAT_WS('_', 'foo', 'bar', 'baz');
+-------------------------------------+
| CONCAT_WS('_', 'foo', 'bar', 'baz') |
+-------------------------------------+
| foo_bar_baz                         |
+-------------------------------------+
SELECT CONCAT_WS('', 'foo', NULL, 'bar');
+-----------------------------------+
| CONCAT_WS('', 'foo', NULL, 'bar') |
+-----------------------------------+
| foobar                            |
+-----------------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES