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

分别满足两个活动的人

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

select 
distinct
uid,
'activity1' activity
from 
exam_record
where 
score is not null
and uid not in (
    select uid
    from exam_record
    where score<85
)
union all
select 
distinct
uid,
'activity2' activity
from 
exam_record a,
examination_info b
where a.exam_id=b.exam_id
and b.difficulty='hard'
and a.score>80
and TIMESTAMPDIFF(SECOND,start_time,submit_time)<=1800
order by uid

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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