I have 2 tables:
people
person_id int
FirstName varchar
LastName varchar
people_codes
person_id int
code varchar
primary bit
If I join the tables I get something like this:
firstName lastName code primary
-------------------------------------
John Smith GEN 0
John Smith VAS 1
Aaron Johnson ANE 0
Allison Hunt HOS 0
Ok, so here's the question. How do I query for only the people that have a primary bit of only a 0?
In the above results I only want Aaron and Allison to return, because John Smith has a primary occurrence of 1. Essentially, I can't just say where primary = 0
because I would still get John.
Thank you,
Trout