select * from (
select *,rank() over(order by person_num desc) as rank from
(select remark , count(1) as person_num from wb_user_info group by remark) tmp
) rank_table
where rank <= 5;
第二题 各频道参与评论量分布排行,求top5
select * from (
select *,rank() over(order by comment_num desc) as rank from
(
select remark , count(1) as comment_num from wb_comments wc inner join wb_user_info wui
on wc.uid = wui.uid
group by remark
) tmp
) rank_table
where rank <= 5;
第三题 各频道参与评论量分布排行,求top5
select * from (
select *,rank() over(order by repostsTotal desc) as rank from
(
select remark , sum(repostsCount) as repostsTotal from wb_comments wc inner join wb_user_info wui
on wc.uid = wui.uid
group by remark
) tmp
) rank_table
where rank <= 5;
第一题 各频道参与博主的人数分布排行,求top5select * from ( select *,rank() over(order by person_num desc) as rank from (select remark , count(1) as person_num from wb_user_info group by remark) tmp) rank_table where rank <= 5;第二题 各频道参与评论量分布排行,求top5select