0
a和c都是具有400條記錄的同一個表。 b和d與300個記錄也是同一張表。然而需要大約4分鐘來運行這個。我如何加快速度?SQL運行時間太長
select a.docref
from a
left outer b
on a.cono=b.cono and a.tt=b.tt and a.docref=b.docref
where a.cono='VC'
and b.accn08='9005100'
and a.pstper=11609
and a.cbpref not in (select c.cbpref
from c
left outer join d
on c.cono=d.cono and c.tt=d.tt and c.docref=d.docref
where c.cono='VC'
and d.accn08='9005100'
and c.pstper=11609
and c.tt='RX')