你可以先查下这道题一共回答了几次,然后查一下回答同一答案的次数,除一下转成百分比就好了。
int a = select count(*) from 表 where ques_id=5; int b = select count(*) from 表 where ques_id=5 AND answer_value=2; int c = a/b;
先查下这道题一共回答了几次,然后查一下回答同一答案的次数,除一下转成百分