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

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

https://www.nowcoder.com/practice/422dcd6ae72c49c9bbec1aff90d69806

with t1 as
(
    select 
    emp_id,
    exam_id,
    score,
    AVG(score) over(partition by exam_id) as avg_sco,
    timestampdiff(second, start_time, submit_time) as all_time,
    AVG(timestampdiff(second, start_time, submit_time)) over(partition by exam_id) as avg_time
    from 
    exam_record
)
,
t3 as
(
select * from t1 where score > avg_sco and all_time < avg_time
)

select 
emp_info.emp_id,
emp_level,
tag
from 
t3 
left join emp_info on t3.emp_id = emp_info.emp_id
left join examination_info on t3.exam_id = examination_info.exam_id
where emp_level < 7

全部评论

相关推荐

迷茫的大四🐶:💐孝子启动失败,改为启动咏鹅
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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