刷数据的SQL

从变动表更新主表的更新时间

update employee_info,(select employee_id ,max(upd_time) as upd_time from employee_change group by employee_id) tt set employee_info.upd_time=tt.upd_time where employee_info.employee_id=tt.employee_id

从终端更新主表数据

update employee_info,institution_terminal
set employee_info.store_type=institution_terminal.store_type,
employee_info.employee_customer=institution_terminal.employee_customer,
employee_info.employee_biostime_type=institution_terminal.biostime_type
where employee_status=’在职’ and employee_info.terminal_code is not null and
employee_info.terminal_code=institution_terminal.terminal_code

本文链接:https://dupii.com/72.html,转载请注明出处。

评论0

没有账号?注册  忘记密码?