CONCAT_WS()
CONCAT_WS() is a SQL function in the String Functions category. Concatenates strings with a separator (CONCAT With Separator). Skips NULL values. The syntax is CONCAT_WS(separator, string1, string2, ...). It accepts separator, string1, string2, .... It returns separator-joined string. A typical example: SELECT CONCAT_WS(' - ', first_name, middle_name, last_name) FROM employees; -- John - Michael - Doe -- Skips NULL middle names gracefully A close relative is CONCAT(), which concatenates two or more strings into one string. Returns NULL if any argument is NULL. A close relative is SUBSTRING(), which extracts characters from a string starting at position `start` for `length` characters. A close relative is REPLACE(), which replaces all occurrences of `from_string` with `to_string` in a string. More about this category: String manipulation — CONCAT, SUBSTRING, REPLACE, TRIM, UPPER, LOWER, LENGTH. Related String Functions entries: CONCAT(), SUBSTRING(), REPLACE(), LENGTH(), TRIM(), UPPER(), LOWER(), LPAD() / RPAD().