读书人

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

发布时间: 2012-08-09 15:59:21 作者: rapoo

此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……

读书人网 >SQL Server

热点推荐