• 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)
  • 相关阅读:
    有没有用户体验+UI+前端集于一身的人
    ruby array.count
    ruby subset
    向李刚同学道歉
    rails3转载
    RVM and Capistrano
    paperclip自定制文件名
    ruby爬虫
    rails3已经内置subdomain
    摘录
  • 原文地址:https://www.cnblogs.com/xgxhellboy/p/3135128.html
Copyright © 2020-2023  润新知