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

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

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

select 
tid,
uv,
pv
from 
(
    select 
exam_id tid,
count(distinct uid) uv,
count(exam_id) pv
from 
exam_record
group by exam_id
order by uv desc,pv desc
) a
union all
select 
tid,
 uv,
pv
from 
(
    select 
question_id tid,
count(distinct uid) uv,
count(question_id) pv
from 
practice_record
group by question_id
order by uv desc,pv desc
) b

全部评论

相关推荐

04-28 22:33
已编辑
门头沟学院 C++
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务