Sql批量更新效率问题(数据量比较多,运行效率低下)
请教,我需要根据两张表的对比结果进行数据的批量更新(数据量比较多,运行效率低下),请教,我的这些语句如何能更好的优化以提升效率?
update Eit a set (
user_id,
full_name,
sex,
birthday,
native_place,
duty_code,
job_code,
company_id,
dept_id,
email,
mobile,
phone,
update_date,
ehr_pk_psndoc,
user_type,
his_stats
)=(
select
user_id,
full_name,
sex,
TO_DATE(birthday, 'YYYY-MM-DD'),
native_place,dutycode,
job_code,
company_id,
dept_id,
email,
mobile,
phone,
sysdate,
ehr_pk_psndoc,
'0',
'1'
from v_ehr_eit_users b
where b.user_name=a.user_name)
where exists(select 1 from v_ehr_eit_users b where b.user_name=a.user_name)