The || operator in Oracle SQL / PLSQL can be used to concatenate multiple strings to form a single string.
Syntax for the using the || operator in Oracle SQL / PLSQL is:
SELECT string_1 || string_2 || string_3 || . . . || string_N
FROM table_name;
string_1, strring_2 . . string_N are the strings to be concatenated.
Examples:
Using || operator in Oracle SQL / PLSQL SELECT statement:
1 | SELECT 'MONDAY ' || 'TUESDAY ' || 'WEDNESDAY ' |
2 | FROM dual; |
Will return ‘MONDAY TUESDAY WEDNESDAY ‘
1 | SELECT 'TECH' || 'HONEY' || '.COM' |
2 | FROM dual; |
Will return ‘TECHHONEY.COM’