题解 | 完成员工考核试卷突出的非领导员工

select
    a.emp_id as emp_id,
    emp_level,
    tag as exam_tag
from
    emp_info a,
    examination_info b,
    (
        select
            *,
            avg(timestampdiff (second, start_time, submit_time)) over (
                partition by
                    exam_id
            ) as avg_time,
            avg(score) over (
                partition by
                    exam_id
            ) as avg_score
        from
            exam_record
    ) c
where
    a.emp_id = c.emp_id
    and b.exam_id = c.exam_id
    and timestampdiff (second, start_time, submit_time) < avg_time
    and score > avg_score
    and emp_level < 7
group by
    b.exam_id,
    tag,
    a.emp_id
order by
    a.emp_id,
    b.exam_id

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-08 10:39
一个证都没&nbsp;我能填什么
程序员小白条:别人有,你为什么没有,还是这个道理,社会就是比较,竞争,淘汰,你要安逸,那么就要做好淘汰的准备
点赞 评论 收藏
分享
流浪的神仙:无恶意,算法一般好像都得9硕才能干算法太卷啦
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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