This is kinda confusing, therefore I will explain my goal step by step, Below are the tables that I am working on (First Table, Second Table, and Third Table). First, I need to verify if the username
from the Second Table does exist on the First Table, if not, remove the one that has no common username
The outcome should be something like this (George was excluded since it has no common username to First Table):
user_id | username
5423 | Bob
43 | Vicky
THEN I would like to verify by comparing the previous results above and the Third Table. My goal is to check if the user_id AND username
from the previous results above has a common rows on the Third Table, if it does, EXCLUDE that one, and only retrieve the unique ones.
The OVERALL results should be the one below since 5423 | Bob
does not exist yet on the Third Table:
OVERALL RESULTS:
user_id | username
5423 | Bob
First Table:
| username
| Bob
| Jessie
| Vicky
Second Table:
user_id | username
5423 | Bob
123 | Georgie
43 | Vicky
Third Table:
user_id | username
1 | Luke
54 | Stephenie
43 | Vicky