请教,我需要根据两张表的对比结果进行数据的批量更新(数据量比较多,运行效率低下),请教,我的这些语句如何能更好的优化以提升效率?
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)
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)
解决方案 »
- 帮忙看两个不确定的选择题
- exception ,异常抛出问题
- 关连子查询--》删除表中重复行
- 使用with字句重用子查询
- 一个关于批量分页查询的很奇怪的问题,诚请高手出马!!(有几个高手都没想明白的问题)
- 怎样在存储过程中根据分区名(part20050621)删除过期的分区?
- 怎样把SELECT的记录保存到本地文件
- Ms SqlServer存储过程转ORACLE格式,请求帮助!
- 多级编码的排序
- 本地计算机上的ArcSde Sercice(esri_sde)服务启动后停止。某些服务未在由其他服务或进程使用时将自动停止。
- 跪求 高手—帮忙《表类型如何定义一个存放线的表》
- 关于表分析的一些参数请求帮助???
V_EHR_EIT_USERS为视图
这个更新效率怎么能提高速度呢?
数据量大的话可以考虑分段commit