题解 | #某乎问答高质量的回答中用户属于各级别的数量#
某乎问答高质量的回答中用户属于各级别的数量
https://www.nowcoder.com/practice/69c85db3e59245efb7cee51996fe2273
select level_cut,sum(cnt) num from ( select case when a.author_level>=1 and a.author_level<=2 then '1-2级' when a.author_level>=3 and a.author_level<=4 then '3-4级' when a.author_level>=5 and a.author_level<=6 then '5-6级' else '0' end as level_cut, count(1) cnt from author_tb a, answer_tb b where a.author_id = b.author_id and char_len > 100 group by a.author_level ) c group by c.level_cut order by sum(cnt) desc