Join two tables into one in SQL Server

0

I have the following questions:

SELECT *
FROM #TABLE_AR_5

SELECT *
FROM #TABLE_AR_6

This is my result:

I need the information to be in a single table, I look for this result:

    
asked by ARR 13.11.2018 в 21:15
source

1 answer

2

You apply the inner JOIN statement to the TERRITORIAL field Example:

SELECT TABLE_AR_5.TERRITORIAL,TABLE_AR_5.ENE,TABLE_AR_6.FEB
FROM TABLE_AR_5
INNER JOIN TABLE_AR_6 ON TABLE_AR_6.TERRITORIAL=TABLE_AR_5.TERRITORIAL

Another option would be with UNION

    
answered by 13.11.2018 / 21:28
source