Reputation: 814
I have two table.
I want to select all data from two tables and customize columns as follow (change name column Product_X
and Product_Y
to Product
, add two column Color
and Weight
,.etc..).
Please see image
I think i should use JOIN
, but I still have no idea about this issue.
Upvotes: 0
Views: 50
Reputation: 31879
You need to use UNION ALL
:
SELECT
Category,
Product_X AS Product,
Price,
Color,
NULL AS Weight
FROM TableA
UNION ALL
SELECT
Category,
Product_Y,
Price,
NULL,
Weight
FROM TableB
Upvotes: 2