SQL Concatenate Columns: Quick Guide
In SQL, two columns can be joined into one column by using the string concatenation function CONCAT() or using the + operator for concatenation.
Syntax for using the CONCAT() function is as follows:
SELECT CONCAT(column1, column2) AS new_column_name
FROM table_name;
The syntax for using the + operator is as follows:
SELECT column1 || column2 AS new_column_name
FROM table_name;
In the above syntax, column1 and column2 are the two columns to be joined, new_column_name is the newly created column name, and table_name is the table to be queried.