• Ian Massi (10/31/2008)


    I would group by department having count(*) = 0.

    won't the count be equal to or greater than 1 always? if the count is 0, then it doesn't exist

    I guess if you did a left join a did a count on the employeeid which a count(null) = 0? since null's are excluded from aggrigate functions?

    probably still faster to do there left join where emp.deptid is null since it won't require grouping everything together.