Concatenated expressions

Concatenation allows you to combine column values or combine a column value with another value, by using a concatenation operator (CONCAT, ||, or +). A concatenated expression can include character values or binary values, but not both:

Character Values
Concatenated character values can be character columns, string literals, substrings of values in character columns, the sequential function, or the random function.
Binary Values
Concatenated character values can be binary columns, hexadecimal literals, substrings of binary columns, the sequential function, or the random function.

Example

Assume that the CUSTOMERS table stores an address in two columns: ADDRESS1 and ADDRESS2. The SHIP_TO table stores an address in one column: ADDRESS. You can use a concatenated expression to combine address information from two columns in one table to one column in another.

To combine the address, specify one of the following examples:

CUSTOMERS Table SHIP_TO Table
ADDRESS1 || ADDRESS2 ADDRESS
ADDRESS1 CONCAT ADDRESS2 ADDRESS
ADDRESS1 + ADDRESS2 ADDRESS


Feedback