MySQL Forums
Forum List  »  Newbie

Re: Calculate Percentage with Count
Posted by: Peter Brawley
Date: October 24, 2014 10:50AM

Write a pivot table ...

select id,
  sum( if(mark>=90,1,0) ) as '90%+',
  sum( if(mark between 81 and 90,1,0) ) as '81-90%',
  ...etc...
from ...
group by id;


More on the subject under "Pivot tables" at http://www.artfulsoftware.com/queries.php

Options: ReplyQuote


Subject
Written By
Posted
Re: Calculate Percentage with Count
October 24, 2014 10:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.