Get highest answer rate question
@kexiao1612 How to deal, there is two or more same max rate, limit 1 can not have multi question_id
No one has replied
@kexiao1612 Thanks for correcting. Everything looks fine now.
sum(case when answer_id is not Null then 1 end)/sum(case when action ='show' then 1 end) as rate
sum(case when answer_id is not Null then 1 else 0 end)/sum(case when action ='show' then 1 else 0 end) as rate
count(case when answer_id is not Null then 1 else NULL end)/count(case when action ='show' then 1 else NULL end) as rate
these three case statements are same.
Update: I saw the definition of answer rate. But it still cannot clear my concern on this case.
#285 answer rate = 0/2
#369 answer rate = 1/0
Besides, it is very weird that problem 369 has no 'show' but a 'answer' record.
Disabled Categories are greyed out
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.