What is SQL Concatenation?
Concatenation is the process of combining data strings.
For example, the concatenation of 'John', ' ', 'W', '. ' and 'Smith' is
'John W. Smith'
Also, the concatenation of '212', '-', '555', '-' and '1234' is
Why Use SQL Concatenation?
Concatenation can result in more readable output while maintaining data in separate columns for greater flexibility.
How To Use SQL Concatenation
The means of achieving concatenation differs by database type. for example:
More than 2 strings can be combined through concatenation. Numbers must be converted to strings before concatenation.
SQL Concatenation Syntax
SQL Concatenation Example
The following example concatenates the column branch_name with column region_name along with spaces and parens for readability.
Here are the contents of the tables:
This SQL Statement with concatenation is executed:
Here is the result.