题解 | #查询每天刷题通过数最多的前二名用户id和刷题数#
查询每天刷题通过数最多的前二名用户id和刷题数
https://www.nowcoder.com/practice/b9cc0d5047f94bc0a661c5a0a230b9cd
with
t1 as (
select
*,
row_number() over (
partition by
date
order by
pass_count desc
) as rn
from
questions_pass_record
)
select
date,
user_id,
pass_count
from
t1
where
rn <= 2;
查看1道真题和解析