select sum(a) a,sum(b) b,sum(c) c,SUM(d) d,sum(a1) a1,sum(b1) b1,sum(c1) c1,SUM(d1) d1
from
(
select case x when 'a' THEN y else 0 end a,
case x when 'b' THEN y else 0 end b,
case x when 'c' THEN y else 0 end c,
case x when 'd' THEN y else 0 end d,
case x when 'a1' THEN y else 0 end a1,
case x when 'b1' THEN y else 0 end b1,
case x when 'c1' THEN y else 0 end c1,
case x when 'd1' THEN y else 0 end d1
from
(
sELECT 'a' x,COUNT(*) y from NCR_HC_FAB2INLINE a
union all
sELECT 'b' x,COUNT(*) y from NCR_HC_FAB3INLINE b
union all
sELECT 'c' x,COUNT(*) y from NCR_HC_FAB2Offline c
union all
sELECT 'd' x,COUNT(*) y from NCR_HC_FAB3Offline d
UNION ALL
sELECT 'a1' x,COUNT(*) y from NCR_HC_FAB2INLINE a1 WHERE isnull(ifcf,'0')!='0'
union all
sELECT 'b1' x,COUNT(*) y from NCR_HC_FAB3INLINE b1 WHERE isnull(ifcf,'0')!='0'
union all
sELECT 'c1' x,COUNT(*) y from NCR_HC_FAB2Offline c1 WHERE isnull(ifcf,'0')!='0'
union all
sELECT 'd1' x,COUNT(*) y from NCR_HC_FAB3Offline d1 WHERE isnull(ifcf,'0')!='0'
) as w
) as y

最新文章

  1. linux 下第一个Libevent代码学习
  2. 剑指Offer面试题:11.打印1到最大的n位数
  3. IO(三)----序列流
  4. 一般处理程序获取WEB窗体创建的验证码需要实现session相关接口
  5. C++ std::map::erase用法及其陷阱
  6. C#窗体 流
  7. npm命令总结
  8. processor, memory, I/O
  9. 通过struts.xml搭建、为属性注入值_2015.01.04
  10. [转]UOS 中的虚拟网络设备
  11. 解决php json_encode 出现的中文转码、乱码问题
  12. html中的banner自适应屏幕代码
  13. linux5.8安装oracle10g过程记录,换实例一定要改profile的配置
  14. c#反射执行静态方法
  15. asp.net mvc webapi 实用的接口加密方法
  16. python,字符串方法
  17. linux连接数过多,导致ping包丢包的问题解析
  18. A Bayesian Approach to Deep Neural Network Adaptation with Applications to Robust Automatic Speech Recognition
  19. django设置并获取cookie/session,文件上传,ajax接收文件,post/get请求及跨域请求等的方法
  20. 027 ResourceBundle.getBundle方法

热门文章

  1. MongoDB - 分片简介
  2. Vue 修改对象(数组)没有立即生效
  3. 小H的小屋
  4. 对 Pulsar 集群的压测与优化
  5. 顺手写的redis分布式锁
  6. 服务器设置导致mongo数据库的链接数受限
  7. C#NPOI操作Excel,实现Excel数据导入导出(支持多个sheet)
  8. UBUNTU安装代码阅读器Understand
  9. 使用flex布局(多行,一行三个),换行后最后一行左右对齐问题
  10. js循环判断创建新对象放数组中