I am trying to find the difference of ID from 2 tables. I have posted the sample data of Table 1 and Table 2. I was thinking of using OUTER JOIN, but realized that may not be the best idea. What is a simple way to find the desired goal using JOIN? Would any JOIN clause help in this case? If not, what is the best (yet simple) approach to this? I appreciate everyone's help with this!
Table 1:
Person | Package ID | Date |
---|---|---|
1 | Y788 | 01-01-2020 |
2 | T932 | 01-02-2020 |
3 | W345 | 01-03-2020 |
3 | S122 | 01-03-2020 |
4 | F567 | 01-04-2020 |
4 | H767 | 01-04-2020 |
Table 2:
Person | Package ID | Date |
---|---|---|
1 | Y788 | 01-01-2020 |
2 | T932 | 01-02-2020 |
3 | W345, S122 | 01-03-2020 |
4 | F567, H767 | 01-04-2020 |
5 | C555 | 01-05-2020 |
Desired Goal (after coding):
Person | Package ID | Date |
---|---|---|
5 | C555 | 01-05-2020 |
Code:
SELECT Person, Package ID, Date
from table1, table2
OUTER JOIN Person.table1 = Person.table2
Group by Date
Order by Person;