Merge 2 tables with different size and columns

Greeting
im working with 2 tables
Table Store
Store ID | Store Name
1 | AAA
2 | BBB
3 | CCC

Table 2
StoreView
Store ID | NumberOfemployees
2 | 50
3 | 60

i want my out put to be something like this

Dimesnion Store

StoreID | StoreName | NumberOFemployees
1 | AAA | NULL
2 | BBB | 50
3 | CCC [ 60

any Query on how to do this ! i tried Union but it return for me "All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists."

Thanks in advance

You need to do a JOIN of the tables. Read any reference (on the net or in a book) on JOIN and it should be clear. Heppy learning.

1 Like

Here's the query you need. If you any qs, feel free to ask :smile:

SELECT S.StoreID, S.[Store Name], SV.NumberOfEmployees
FROM Store S
LEFT OUTER JOIN StoreView SV ON SV.[Store ID] = S.[Store ID]
1 Like

Thanks Scott ! !!