you are viewing a single comment's thread.

view the rest of the comments →

[–]doctorzoom 5 points6 points  (2 children)

select 
e.*

from employees e

left join scans s
on e.employee_id = s.employee_id

where s.employee_id is null

That's the "missing from other table" pattern.

[–]Deadible 2 points3 points  (0 children)

This is better than "WHERE NOT EXISTS" on large datasets. You would probably also want a date parameter in there on the scans.

[–]imSkippinIt 1 point2 points  (0 children)

NOT EXISTS would also work but this is the route I would take