我在 Oracle Apex 11.1 上有这段代码:
select r.s_manager_id,r.s_manager_nam,count(distinct(emp_id))Total_Employees,
round((SUM(decode(bcoe,'y',1,0))/count(bcoe))*100,2)||'%'bcoe,
round((SUM(decode(ecp,'y',1,0))/count(ecp))*100,2)||'%'ecp,
round((SUM(decode(leave,'y',1,0))/count(leave))*100,2)||'%'leave,
round((SUM(decode(eud,'y',1,0))/count(eud))*100,2)||'%'eud,
round((SUM(decode(parking,'y',1,0))/count(parking))*100,2)||'%'parking,
round((SUM(decode(building,'y',1,0))/count(building))*100,2)||'%'building
from s_manager r,cmanager c,compliancetype t
where r.s_manager_id = c.s_manager_id
AND c.s_manager_id = t.s_manager_id
AND month = 'Feb'
GROUP BY r.s_manager_id,r.s_manager_nam
它计算不同类型的合规性,但ecp
应该bcoe
每年计算一次。如何在 Oracle Apex 中做到这一点?然后leave
应该按季度计算;怎么做?