题解 | #牛客直播各科目出勤率#

牛客直播各科目出勤率

https://www.nowcoder.com/practice/0cab547df4f0430b93042128f445d899

select b.course_id,course_name,
    round(count(distinct(case when timestampdiff(minute,in_datetime,out_datetime)>=10 then b.user_id else null end ))*100/count(distinct (case when if_sign = 1 then b.user_id else null end)),2)  as attend_rate
from course_tb c 
right join behavior_tb b
on c.course_id=b.course_id
left join attend_tb a 
on b.user_id=a.user_id and b.course_id=a.course_id
group by b.course_id,course_name
order by b.course_id

全部评论

相关推荐

牛客48784610...:深圳的变成录用进行中,这个是稳了吗,还没有收到邮件
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务