首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

此sql可否优化,100多万行数据

2012-08-09 
此sql能否优化,100多万行数据此sql能否优化,view_zy_detail_charge_b 中146多万行数据, yb_yinghai_zy_mx

此sql能否优化,100多万行数据
此sql能否优化,view_zy_detail_charge_b 中146多万行数据, yb_yinghai_zy_mx 91万多行
优化一下,不使用not exists,请高手指点。。。

select * from view_zy_detail_charge_b a 
where inpatient_no = '2011102166' 
  and admiss_times = 3 
  and not exists (select 1 from yb_yinghai_zy_mx b where a.detail_sn = b.yka105)

[解决办法]
view_zy_detail_charge_b是视图?

最好把视图代码拆分出来,把where子句条件加进去.
[解决办法]

探讨
引用:

引用:
引用:

select * from view_zy_detail_charge_b a
where inpatient_no = '2011102166'
and admiss_times = 3
and not exists (select 1 from yb_yinghai_zy_mx b where a.de……

热点排行