Question Locked

access query

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i have a database having a table of student as given below
stId,Name,instituteName,Sex,sector
1 a b m public
2 b c f private

100 z u f public
now i want to count how many student r girls and how many boys also want the number of student from orivate and public school

3 replies

by tony hopkinson

Select Sex, Count(stld)
From Students
Group By Sex

Type of school, I'll leave as an exercise for the class

If you just want the number of boys
Select Count(*) from Students Where Sex = 'male'

or some such will do it.

HtHs

by gruntingdwarf

This kind of query presents you with a matricial grid where rows are the values of one column of your table and grid columns are the values of another column of your table, storing group calculations (subtotals, counts) on the intersect cells.

So you could get a grid like this:

-- priv publ
F 231 455 686
M 340 414 754
-- 571 869 1440

Such an array seems to fit your needs, I hope.

This discussion is closed to new replies.