题解 | #分别满足两个活动的人#

分别满足两个活动的人

https://www.nowcoder.com/practice/a126cea91d7045e399b8ecdcadfb326f

select * from
(select uid
,'activity1' as activity
from exam_record
where uid not in (
    select uid from exam_record
    where score < 85
) and year(submit_time) = 2021
) as x

union

(select distinct uid
,'activity2' as activity
from exam_record er
join examination_info ei on er.exam_id = ei.exam_id
where 
timestampdiff(minute, start_time, submit_time) < duration / 2 and 
difficulty = 'hard' 
and score > 80
and year(submit_time) = 2021)

order by uid
;

全部评论

相关推荐

投了十几个无人回应
花环鞣: 佬,我隔壁的
点赞 评论 收藏
分享
牛客41077653...:想问一下华为池子是不是很大呀
点赞 评论 收藏
分享
bangbangba...:感觉三个项目可以融在一起,比如上层是用手写的epoll,然后到tcp聊天层,然后你写了一个后台监控(不过我也不懂c++,但是感觉写一个大项目比三个小项目要好)
我的求职进度条
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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