Question:
I have an employee table with a field empno (employee number) and an hours table that contains all time that is worked by all employees.The hours table has the empno field also. What I am trying to do is get a list of inactive employees; that is, all employees that haven’t any entries in the hours table. Is there a simple way to do this?
Answer:
Sure. Try something like this:
SELECT empno FROM Employees WHERE empno NOT IN (SELECT empno FROM Hours);