求助,如何优化这段SQL语句,求方法思路。
select a.jgbh,a.jgmc,a.jgdm,a.jgjb, (select nvl(count(*),0) as xlzs from t_sc_sbzb where jgbh=a.jgbh and sjsbid='XLZXL' and dydjid='8c196deec1e6446db45b41107b9c924c') as xlzs, --1.188 (select nvl(count(*),0) as sl from t_sys_jgb jgb,t_sc_sbzb sb,t_sc_pdsb_pjmx_xl xl where jgb.jgbh=sb.jgbh and sb.sbid=xl.sbid and to_char(xl.pdrq,'yyyy')='2007' and jgb.jgbh=a.jgbh and xl.xldy='10KV' ) as xlpj,--1.687 (select nvl(count(*),0) as sl from t_sys_jgb jgb,t_sc_sbzb sb,t_sc_pdsb_pjmx_xl xl where jgb.jgbh=sb.jgbh and sb.sbid=xl.sbid and to_char(xl.pdrq,'yyyy')='2007' and jgb.jgbh=a.jgbh and xl.xlpddj='一类设备' and xl.xldy='10KV') as xlpj1, --2.922 (select nvl(sum(gt.dj),0)/1000 as xlzcd from t_sc_sbzb sb,t_sc_sbzb sb1,t_sc_gtxx gt, t_sys_jgb jgb,t_sc_xl xl where sb.jgbh=jgb.jgbh and sb.sbid=sb1.sjsbid and sb1.sbid=gt.sbid and sb.sbid=xl.sbid and jgb.jgbh=a.jgbh and sb.sbzt='运行' and sb.dydjid='8c196deec1e6446db45b41107b9c924c' )+ --2.485 (select nvl(sum(pds.dj),0)/1000 as xlzcd from t_sc_sbzb sb,t_sc_pds pds,t_sys_jgb jgb where jgb.jgbh=sb.jgbh and sb.sbid=pds.sbid and jgb.jgbh=a.jgbh and sb.sbzt='运行' and sb.dydjid='8c196deec1e6446db45b41107b9c924c' ) as xlzcd, --1.162 from t_sys_jgb awhere a.state='有效' and a.jgbm<>'变电站级' and a.xjjgbhc like'%da342c926f264fb0bacfc5c2f68db271%' --25.203 and jgjb<=3 order by a.jgjb