- The
NULLIF
expression reduces blank Middlename
to NULL
- Concatenating
'-'
with a NULL
will always return NULL
- The
VALUE
expression replaces NULL
s with an empty string
_
SELECT Firstname || VALUE( '-' || NULLIF('Middlename',''),'') || '-' || Surname'
AS example_column
FROM example_table