大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说对符合条件的 数据统计个数「终于解决」,希望您对编程的造诣更进一步.
select max(m.check_score) as jcmax , min(m.check_score) as jcmin ,avg(m.check_score) as jcavg ,count(*) as jccount ,sum( case when m.check_score >=80 then 1 else 0 end) as jcdbs
, max(m.self_score) as zcmax , min(m.self_score) as zcmin ,avg(m.self_score) as zcavg ,count(*) as zccount ,sum( case when m.self_score >=80 then 1 else 0 end) as zcdbs
from tb_report_anfang_result m,
(select max(create_time) as create_time , dept_id from tb_report_anfang_result r where r.dept_id in
<foreach collection="depts" item="item" index="index"
separator="," open="(" close=")">
#{item.deptId}
</foreach>
and to_days(r.create_time) <![CDATA[ <= ]]> to_days(#{datetime}) group by r.dept_id ) as temp
where m.create_time = temp.create_time and m.dept_id = temp.dept_id
代码100分
select count(*) as rys ,
sum( case when binglileixing = “XX人员” then 1 else 0 end) as mjry ,
sum( case when isMeetCondition = 1 then 1 else 0 end) as glqwmry ,
sum( case when photourl is not null then 1 else 0 end) as xczm
from fgtb_tianbao where lid in (76,77)
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/9561.html