Home > database >  Small white for help: how to realize the multiple data statistics, thank you
Small white for help: how to realize the multiple data statistics, thank you

Time:10-13

Suppose you have this a data table: high school
XXMC XSXM xb RXSJ
1 wang a man 2019
One two female 2017
1 wang three male 2018
One king four men 2018
2 the li male 2019
2 Li Er female 2017
2 li three male 2018
2 li si men 2018
3 zhao one male 2019
Two women 2017
3 zhao3 zhao three male 2018
3 zhao four men 2018
I'd like to make a statistics into the following situation:
XXMC total number of boys girls in the class of 2019 students in grade 2019 boys number is the number of students in grade 2019 girls in 2018 the number of girls in grade 2018 boys in 2018 the number of male students in grade 2017 students in 2017 grade 2017 girls
One 4 3 1 1 1 1 0 0 2 2 0 1
1 1 2 3 4 1 2 2 0 0 0 1
3 4 3 1 1 1 2 2 0 0 0 1
Consult a great god, how should I write statement, thank you

CodePudding user response:

A simple stupid method:
First establish a query, using the iif function, according to gender, year, create a new field in the query, to separate the original data, and then through the query, create a summary query, there will be a need to the field of aggregate,

  • Related