update hrsa_tax_agent_emp set delete_type = 3
where id in(

    select id from hrsa_tax_agent_emp
    where  tax_agent_id =27 and delete_type = 0 and employee_id not in (select employee_id from hrsa_salary_archive where tax_agent_id =27 and delete_type = 0)

)