SQL codeselect sx201008.stmc stmc,(nvl(sx201008.i_kaizhangsl,0)+nvl(sx201009.i_kaizhangsl,0)+nvl(sx201010.i_kaizhangsl,0)+nvl(sx201011.i_kaizhangsl,0)) i_kaizhangsl,'预警分析' title,'2010-11-29' rq,'徐州首创' sx

,'6798023' jhsl,'80' red,'100' yellow

from (select '徐州首创' stmc,0+sum(i_zongyongl) i_kaizhangsl

from IBCS_XZ.ZW_YINGYEZ201008 a

inner join IBCS_XZ.ZW_YINGYEZ_ZB201008 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201008

and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201008

left join

(select '徐州首创' stmc,450776+sum(i_zongyongl) i_kaizhangsl

from IBCS_XZ.ZW_YINGYEZ201009 a

inner join IBCS_XZ.ZW_YINGYEZ_ZB201009 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201009 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201009 on sx201009.stmc=sx201008.stmc

left join

(select '徐州首创' stmc,-17120+sum(i_zongyongl) i_kaizhangsl

from IBCS_XZ.ZW_YINGYEZ201010 a

inner join IBCS_XZ.ZW_YINGYEZ_ZB201010 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201010 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201010 on sx201010.stmc=sx201008.stmc

left join

(select '徐州首创' stmc,sum(i_zongyongl)-16506 i_kaizhangsl

from IBCS_XZ.zw_yingyez a

inner join IBCS_XZ.zw_yingyez_zb b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201011 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201011 on sx201011.stmc=sx201008.stmc

union all

select sx201003.stmc stmc,(nvl(sx201003.i_kaizhangsl,0)+nvl(sx201004.i_kaizhangsl,0)+nvl(sx201005.i_kaizhangsl,0)+nvl(sx201006.i_kaizhangsl,0)+nvl(sx201007.i_kaizhangsl,0)+nvl(sx201008.i_kaizhangsl,0)+nvl(sx201009.i_kaizhangsl,0)+nvl(sx201010.i_kaizhangsl,0)+nvl(sx201011.i_kaizhangsl,0)) i_kaizhangsl,'预警分析' title,'2010-11-29' rq,'铜陵首创' sx

,'43677613' jhsl,'80' red,'100' yellow

from (select '铜陵首创' stmc,0+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.ZW_YINGYEZ201003 a

inner join IBCS_TL.ZW_YINGYEZ_ZB201003 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201003

and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201003

left join

(select '铜陵首创' stmc,75278+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.ZW_YINGYEZ201004 a

inner join IBCS_TL.ZW_YINGYEZ_ZB201004 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201004 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201004 on sx201004.stmc=sx201003.stmc

left join

(select '铜陵首创' stmc,142742+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.ZW_YINGYEZ201005 a

inner join IBCS_TL.ZW_YINGYEZ_ZB201005 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201005 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201005 on sx201005.stmc=sx201003.stmc

left join

(select '铜陵首创' stmc,55950+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.ZW_YINGYEZ201006 a

inner join IBCS_TL.ZW_YINGYEZ_ZB201006 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201006 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201006 on sx201006.stmc=sx201003.stmc

left join

(select '铜陵首创' stmc,-156033+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.ZW_YINGYEZ201007 a

inner join IBCS_TL.ZW_YINGYEZ_ZB201007 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201007 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201007 on sx201007.stmc=sx201003.stmc

left join

(select '铜陵首创' stmc,82416+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.ZW_YINGYEZ201008 a

inner join IBCS_TL.ZW_YINGYEZ_ZB201008 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201008 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201008 on sx201008.stmc=sx201003.stmc

left join

(select '铜陵首创' stmc,25169+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.ZW_YINGYEZ201009 a

inner join IBCS_TL.ZW_YINGYEZ_ZB201009 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201009 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201009 on sx201009.stmc=sx201003.stmc

left join

(select '铜陵首创' stmc,-36730+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.ZW_YINGYEZ201010 a

inner join IBCS_TL.ZW_YINGYEZ_ZB201010 b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201010 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201010 on sx201010.stmc=sx201003.stmc

left join

(select '铜陵首创' stmc,44304+sum(i_zongyongl) i_kaizhangsl

from IBCS_TL.zw_yingyez a

inner join IBCS_TL.zw_yingyez_zb b on a.i_feeid=b.i_feeid

where a.i_jlzt=0 and i_y*100+i_m=201011 and b.i_jlzt=0 and i_feiyongdlbh=580

and i_xiaozhang<>20) sx201011 on sx201011.stmc=sx201003.stmc

oracle怎么定位效率,oracle查询效率,该怎么解决相关推荐

  1. ORACLE数据库多表关联查询效率问题解决方案

    ORACLE数据库多表关联查询效率问题解决方案 参考文章: (1)ORACLE数据库多表关联查询效率问题解决方案 (2)https://www.cnblogs.com/baib/p/5086777.h ...

  2. oracle使用with as提高查询效率

    经常在开发过程中会用到视图或组合查询的情况,但由于涉及表数据经常达到千万级别的笛卡尔积,而且一段查询时会反复调用,但结果输出往往不需要那么多,可以使用with将过滤或处理后的结果先缓存到临时表(此处原 ...

  3. oracle 查询两张表合并,oracle的多表合并查询-工作心得

    刚刚开发需求写了个SQL,记个笔记,学习下关于数据库的多表合并查询的用法 select t.* from A t UNION ALL/UNION/Intersect/MINUS select s.* ...

  4. 提高oracle查询效率

    转载自: http://zhidao.baidu.com/link?url=E_HaRWGF3wCYYKG1l-qg5pNmjsePoH3wo_81Zpf5GaytfIW869RhWTIR6_jGPh ...

  5. Oracle提高SQL查询效率where语句条件的先后次序

    (1)选择最有效率的表名顺序(只在基于规则的优化器中有效): Oracle的解析器按照从右到左的顺序处理FROM子句中的表名,FROM子句中写在最后的表(基础表 driving table)将被最先处 ...

  6. oracle 跨分区查询效率,Oracle分区表做跨分区查询

    问:有一张大表,其中按时间字段(TIME_ID)进行表分区(按季度分区),但是如果业务人员做跨季度的大批量数据的查询时,未能走TIME_ID分区索引,导致全表扫描.此种情况该如何处理? 示例解析: 1 ...

  7. (转)Oracle中通过位图索引提高查询效率

    本文转自:http://database.ctocio.com.cn/analysis/357/9390857.shtml 众所周知,索引可以在很大程度上提高数据库的查询效率.但是如果索引使用不当,如 ...

  8. oracle 语句提高查询效率的方法

    oracle 语句提高查询效率的方法 1:.. where column in(select * from ... where ...); 2:... where exists (select 'X' ...

  9. Oracle关于date类型的查询方式及效率浅析

    背景:数仓ETL环节通过sqoop抽取某个Oracle业务表时,突然在某天提示sqoop导出错误,重试仍然失败.经过查询源库发现当前增量抽取sql耗时特别久,涉及oracle数据库date类型比较时的 ...

  10. oracle千万级数据模糊查询,oracle模糊查询效率拔高

    分2种思路考虑模糊查询的效率的提高.--注:专注处理百万级数据量,小量数据就算了 第一种:把数据存到业务内存中,通过查询内存提高效率.(要求:硬件内存要高) 1,如果想实现内存动态数据,可以监控表数据 ...

最新文章

  1. oracle-闪回技术2
  2. Ext的viewport在所有浏览器下出现界面内容消失的问题
  3. 【小白学PyTorch】17.TFrec文件的创建与读取
  4. php查询数据存到下一界面_PHP从另一个页面获取数据
  5. Apache+Tomcat中支持“UTF-8”编码的中文地址
  6. creo管道设计教程_CREO/PROE产品设计教程之四芯花线建模,加深对关系式的认识...
  7. 20165332第八周课下作业
  8. QuickBI助你成为分析师——计算字段功能
  9. Hadoop日记Day13---使用hadoop自定义类型处理手机上网日志
  10. 降维系列之 AutoEncoder 自动编码器
  11. 自己实现的promise
  12. b 站视频下载神器合集,支持电脑和手机端
  13. 看美剧《疑犯追踪》,学地道美语 Learn idiomatic American English by watching Tv series Person of Interest
  14. 计算机技术对人脸识别的作用,人脸识别技术有什么功能特点
  15. bt磁力种子与php文件,视频 | BT 种子和磁力链接是如何工作的?
  16. Android APP连接 MySQL
  17. 面试了500个年轻人,发现混得好的,都会这5种说话套路
  18. 阿里云账号实名认证解决方案
  19. Android Studio 4.0 Image Asset 图标不能透明(记录)
  20. source not found解决方法(亲测)

热门文章

  1. 如何更改webstrom的默认端口63342
  2. 实现CA证书创建及客户端申请证书
  3. 动画特效九:下拉刷新
  4. Android Studio Xposed模块编写(一)
  5. MyBatis学习--高级映射
  6. DEV MessageBox
  7. 【转载】进程与线程的区别
  8. 通用 PE 工具箱1.9.6(XP内核)by Uepon(李培聪)
  9. 视频质量评价PSNR
  10. 【Python】读取 txt 文件