Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011

    Unanswered: Query across tables

    I am looking for a little more help on queries. I have 3 tables (ContactInfo, Current Employees, Pot Employees)

    in the potential employee table, it references the contactID as a foreign key. I want to be able to only see a list of individuals if they are not current employees. In other words, if there is an entry in the employeeID field (referenced from the contactinfo table) then I do not want them in my potential employee query.

    I only want to see a list of people NOT in the employee table.

    Thanks in advance

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 15
    You use a Left Join and test for Null values in this case, like this:
    SELECT *
    FROM  ContactInfo LEFT JOIN Current_Employees ON 
          ContactInfo.Contact_id = Current_Employees.Employee_id
    WHERE Current_Employees.Employee_id Is Null;
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts