+ 1
count
if I made a table named class with 10 records. and there is a column named grade in which grades are like - A , B , C , D.. . if I want to count the number of students having respective grades then how can I ?????
2 Answers
+ 22
Select COUNT(Grade) from Class WHERE Grade=... ;
0
SELECT Grade,COUNT(Grade) AS GCount From Class GROUP BY Grade;
This will list down all Grades and their Count side by side.
Result:
Grade | GCount
A | 5
B | 2
If u want to query the count of a perticuler grave u can use Frost's query.