I have two tables in my database:
table_A: table_B:
id user id user
1 Mike 1 Mike
2 Dan 2 Dan
3 Tom 3 Tom
4 Lina 4 Lina
5 Cynthia
6 Sam
My aim is to identify which users in Table_B do not exist in Table_A based on id. I'm new in SQL, and this is what i came up with:
SELECT id FROM Table_B
WHERE B.id NOT IN ( SELECT A.id from Table_A)
Most likely my logic is wrong, so i'd appreciate any guidance please.