Using a Left Join to find records that are Not equal.
Posted on 2012-08-22
I am trying to reconcile the data from two tables. Basically, I need to figure out which entries exists in one table (members), that don't exist in the other (access).
I know by using a LEFT JOIN I can compare the data when they are equal but, how do I display the information that is not equal?
My query is working but, I only want to show the rows that are not equal to each other.
Here is my query:
$get_missing_NUIDs = "SELECT members.NUID FROM members LEFT JOIN access ON members.NUID=access.NUID";
I need to show the members.NUID that are found in the members table but, are not found in the access table.
Thanks for your help!