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)
...全文
2617打赏收藏
此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.det
select * from view_zy_detail_charge_b a left join yb_yinghai_zy_mx b on a.detail_sn = b.yka105
where inpatient_no = '2011102166'
and admiss_times = 3 and b.主键 is null
select a.* from
view_zy_detail_charge_b a left join yb_yinghai_zy_mx b on a.detail_sn = b.yka105
where a.inpatient_no = '2011102166'
and a.admiss_times = 3
and b.主键 IS not null