题解 | #每个题目和每份试卷被作答的人数和次数#

每个题目和每份试卷被作答的人数和次数

https://www.nowcoder.com/practice/203d0aed8928429a8978185d9a03babc


with table1 as ( 
    select exam_id as tid,  uid  , 'exam' as tag   # 构造一个 标签 方便后面按照 试卷题目分别排序
    from exam_record 
    union all 
    select question_id as tid,  uid , 'prac' as tag
    from practice_record
)

select tid , count(distinct uid) as uv, count(uid) as pv
from table1
group by tid , tag
order by tag asc , uv desc , pv desc

全部评论

相关推荐

安静的鲸鱼offer...:神仙级别hr,可遇不可求,甚至他可能也是突然有感而发。只能说遇上是件幸事。
秋招开始捡漏了吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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