题解 | #某乎问答高质量的回答中用户属于各级别的数量#
某乎问答高质量的回答中用户属于各级别的数量
http://www.nowcoder.com/practice/69c85db3e59245efb7cee51996fe2273
回答数为0 的不显示,题目应该更严谨
select case when author_level between 5 and 6 then "5-6级"
when author_level between 3 and 4 then "3-4级"
else "1-2级" end as level_cut,
sum(if(char_len>=100,1,0)) as num
from answer_tb left join author_tb using(author_id)
group by level_cut
having num !=0
order by num desc