from (
select *
from 表
where onduty = no) a
group by name
having count(*) = 5
原理说明:
1.取出所有缺勤记录作为a表
2.取出a表中缺勤次数为5的(因为没有重复记录不会1个人1个礼拜出现5次以上的出勤情况)
select SELECTCOUNT(*),a.visitor_ime from (
select visitor_imei,left(visitor_restime,10) from visitor group by visitor_imei,left(visitor_restime,10)
) a group by visitor_imei HAVING COUNT(visitor_imei)>5
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)