Concatenating Strings with ||
Use the || (concatenation) operator to combine, or concatenate, strings. The || operator’s important characteristics are:
The || operator is two consecutive vertical-bar, or pipe, characters.
Concatenation doesn’t add a space between strings.
||, a dyadic operator, combines two strings into a single string: 'formal' || 'dehyde' is 'formaldehyde'.
You can chain concatenations to combine multiple strings into a single string: 'a' || 'b' || 'c' || 'd' is 'abcd'.
Concatenation with an empty string ('') leaves a string unchanged: 'a' || '' || 'b' is 'ab'.
The result of any concatenation operation that involves a null is null: 'a' || NULL || 'b' is NULL. (But see the Oracle exception in the DBMS Tip in this section.)
To concatenate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access