I have a poll with votes from users. For example:
Do you want a Fiat?
id | answer
1 yes
2 no
3 yes
...
25 no
count = 20 yes / 5 no
(20 * 100) /25 = 80% Yes
(5 * 100) /25 = 20% No
So, 80% want a Fiat, and 20% don't want. Obviously I can do something like:
select answer, count(*) as total from fast_survey group by answer;
However this will show the count and I am looking for the relative percentage. Any idea how can I do that?