Question

Locked

access query

By rafiqkhan81 ·
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

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +
Collapse -

Try something like this

by Tony Hopkinson In reply to access query

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

Collapse -

You may want to read about "crosstab queries"

by GruntingDwarf In reply to access query

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.

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums