Select nvl(to_char(a.create_date, \'yyyy-mm-dd\'), \'合计\') 日期,
       count(case
               when a.flownode_code = \'2\' then
                a.work_id
             end) 工单分配,
       count(case
               when a.flownode_code = \'1001\' then
                a.work_id
             end) 测量,
       count(case
               when a.flownode_code = \'1003\' then
                a.work_id
             end) 外线
  From t_od_work a
 where a.flownode_code in (\'2\', \'1001\', \'1003\')
   and a.create_date >= To_Date(\'2018-08-01\', \'yyyy-mm-dd\')
   and a.create_date <  To_Date(\'2018-09-01\', \'yyyy-mm-dd\')
 group by rollup(to_char(a.create_date, \'yyyy-mm-dd\'))
 order by to_char(a.create_date, \'yyyy-mm-dd\');

 

 

版权声明:本文为wzh313原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/wzh313/articles/9668285.html