- Oracle 查询很久没有结果
where条件中不添加and a.qxjg like 'sx%' 则可执行；
where a.blfsdm in ('010000', '020000')
and b.djjglb = '0000'
and b.QGCCBZ = '1'
and b.xfmddm in ('02', '03')
and a.xfjbh not in (select distinct xfjbh from THXFJXX where a.blsj = blsj) and a.xfjbh not in (select distinct (m.xfjbh) as m_xfjbh from (select distinct t.xfjbh from blfsxx t left join xfjxx b on t.xfjid = b.recordid where (t.bljgdm = '-' or substr(t.bljgdm, 1, 6) = 'BW0061') and b.djjglb = '0000' and (t.blfsdm = '010000' or t.blfsdm = '020000') and b.QGCCBZ = '1' and b.xfmddm in ('02', '03') and t.xfjbh not in (select distinct xfjbh from THXFJXX where t.blsj = blsj)) m inner join (select distinct t.xfjbh from blfsxx t where substr(t.bljgdm, 1, 2) = '61' and t.blfsdm like '04%') n on m.xfjbh = n.xfjbh) and to_char((b.djsj + 30), 'yyyymmdd') <= (select to_char(sysdate, 'yyyymmdd') from dual) and a.qxjg like 'sx%' -- order by to_char((b.djsj + 30), 'yyyymm') || '01' desc /* where q.n_xfjbh is not null and q.n_bljgdm is not null and q.n_blsj is not null*/ ) Y
group by Y.timekey, Y.xzqh, Y.djjglb, Y.nrfldm, Y.xfxs