• OK.

    Still, wouldn't it be better to do this (set-based solution):

    delete employees from employees a left join (select min(id) from employees group by employeeno, employeeid) b on a.id = b.id where b.id is null

    rather than this (RBAR solution):

    delete employees where id NOT IN (select min(id) from employees group by employeeno, employeeid)

    On small tables there probably wouldn't be much difference in performance, but I'm thinking that the set-based solution would be orders of magnitude faster on very large tables.