with qa as (SELECT a.PURDEPTID,b.DEPTNAME, round(COUNT(CASE a.STATUS WHEN '70' THEN '70' ELSE NULL END)/count(a.STATUS),2) count1,'进度值' as f1 FROM PUR_CAIGOUYUBAOCX a LEFT JOIN BD_DEPT b on a.PURDEPTID = b.DEPTID where a.STATUS in ('60','70') and to_char(to_date(a.CREATEDATE,'yyyy-mm-dd hh24:mi:ss'),'dd') = to_char(to_date(sysdate,'yyyy-mm-dd hh24:mi:ss'),'dd') GROUP BY b.DEPTNAME,a.PURDEPTID order by a.PURDEPTID) SELECT * from qa |
最佳回答 |
||||
3
|
|
|||
1
|
|
|||
1
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|