I have two tables
+-----+----------+
| SKU | Quantity |
+-----+----------+
| ABC | 30 |
| DEF | 40 |
+-----+----------+
+-----+----------+
| SKU | OnOrder |
+-----+----------+
| ABC | 90 |
| XYZ | 80 |
+-----+----------+
I want to join both tables on SKU when there is a match, but also return SKU from both tables when there isn't a match. So the results would be:
+-----+---------+---------+
| SKU | OnOrder | OnOrder |
+-----+---------+---------+
| ABC | 90 | 30 |
| DEF | 40 | |
| XYZ | | 80 |
+-----+---------+---------+
I'm thinking this would be accomplished by using a left join and a right join and by doing a union but I can't seem to get the code right.
Your help is much appreciated!