SQL and Counting
问题 I have a table which consists of the following Student Name Grade Class -------------------------------------------------------- User 1 A English User 1 B Math User 2 B Math I'm trying to create a query where it will list all students, total pass grades (grades A,B & C), total A's, Total B's, Total C's Can someone help me create the query or atleast put me in the right direction? 回答1: Give this a try: select name, count(case when grade in ('A', 'B', 'C') then 1 end) totalPass, count(case when