Add Columns Of Two Tables In A Single SQL Query
Posted in
SQL | Joins February 26, 2020
In this article I will demonstrate how to add columns of different tables into one column.
In this article I will demonstrate how to add columns of different tables into one column. This can be done by using single SQL query and no need to write insert query again and again.
Here I give an example to add columns of different tables into one column. We create two tables i.e Users and Users1 having one common column.
Users Table

Users1 Table

To add columns of both tables into one column, write following code snippet:
select a.UserID as UserId, b.UserID as [UId], a.UserID + b.UserID as Addition
from Users as a
inner join Users1 b
on a.UserName=b.UserName
Result
