Created
March 22, 2010 13:06
-
-
Save wojtekmach/340055 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
question_id, cnt, total_cnt, 1.0 * cnt / total_cnt as ratio | |
from ( | |
select question_id, sum(case when correct='f' then 1 else 0 end) as cnt,count(question_id) as total_cnt from quiz_questions group by question_id | |
) | |
order by ratio desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment