select category_name,sum(if(status=1,1,0))/sum(if(status>0,1,0)) pass_rate from audit_log join category_dict on audit_log.object_category=category_dict.category group by object_category select auditor_staff_id,staff_name,department_name from( select auditor_staff_id,avg(creat_time-star_time) avg_time from from audit_log group by auditor_staff_id order by avg_time limit 5) t1 join staff_info on audit_log.auditor_staff_id=staff_info.staff_id order by avg_time desc SELECT m,first(department_name),avg_audit, (avg_audit-last_mon)/last_mon growth_rate from( select *, lag(avg_audit,1) over() last_mon from( select from_unixtime(star_time,'%m') m,department_name count(1)/count(distinct auditor_staff_id) avg_audit form audit_log join staff_info on audit_log.auditor_staff_id=staff_info.staff_id group by m,department_id having m in(7,8)) t1) t2

相关推荐

牛客网
牛客企业服务