zoukankan      html  css  js  c++  java
  • oracle 统计结合横向和纵向统计得结果

    select nvl(t.NAME, '合计') NAME,
           sum(decode(t.vehicletypename, 'A1', j.totalhours, 0.00)) as A1,
           sum(decode(t.vehicletypename, 'B2', j.totalhours, 0.00)) as B2,
           sum(decode(t.vehicletypename, 'C1', j.totalhours, 0.00)) as C1,
           sum(decode(t.vehicletypename, 'C2', j.totalhours, 0.00)) as C2,
           sum(decode(t.vehicletypename, 'C3', j.totalhours, 0.00)) as C3,
           sum(decode(t.vehicletypename, 'C4', j.totalhours, 0.00)) as C4,
           sum(decode(t.vehicletypename, 'A3', j.totalhours, 0.00)) as A3,
           sum(decode(t.vehicletypename, 'B1', j.totalhours, 0.00)) as B1,
           sum(decode(t.vehicletypename, 'A2', j.totalhours, 0.00)) as A2,
           sum(j.totalhours) as "合计"
      from personinfo_view t, person_all_hours j
     where t.ID = j.personid
     group by rollup(t.NAME)
  • 相关阅读:
    bootstrap以及考试复习
    HTML复习
    驼峰命名法和模态对话框
    dom和bom
    dom习题复习和讲解
    DOM
    属性扩展
    sql防注入式攻击
    自动生成编号
    删除,修改,添加
  • 原文地址:https://www.cnblogs.com/xgxhellboy/p/3135128.html
Copyright © 2011-2022 走看看