我自己写的原sqlselect a.xzq,a.bm,a.sj,count(distinct b.SFZ)from(select distinct b.xzq,b.bm,to_date(to_char(a.sj,'yyyy-mm'),'yyyy-mm')as sjfrom a,bwhere a.sfz = b.sfzand a.sj>= to_date('2020-01-01 00:00:00','yyyy-mm-dd hh24:mi:ss')and a.sj < to_date('2020-12-01 00:00:00','yyyy-mm-dd hh24:mi:ss') )aleft join (select b.xzq,b.bm,to_date(to_char(a.sj,'yyyy-mm'),'yyyy-mm')as sj,a.sfzfrom a,bwhere a.sfz = b.sfzand a.sj>= to_date('2020-01-01 00:00:00','yyyy-mm-dd hh24:mi:ss')and a.sj < to_date('2020-12-01 00:00:00','yyyy-mm-dd hh24:mi:ss'))bon (a.xzq=b.xzq and a.bm = b.bm and a.sj>=b.sj)group by a.xzq,a.bm,a.sj运行起来很慢,想请教一下各位大佬,可以改的更简洁一些,更快一些吗,数据库是Oracle