I have a table with 3 columns and looks like
branchid semesterid courseid
4 25 2
4 36 5
4 23 3
4 12 10
4 34 15
4 2 7
4 23 42
7 23 9
7 10 6
7 34 3
7 20 17
I need the count of semesterid and courseid of that branch
SELECT branchid, count(semesterid), count(courseid) WHERE branchid = 4
When I execute this query, the count(semesterid) shows wrong count and courseid shows correct count of 7