I have data in database like this
id class gender 1 A F 2 B F 3 A M 4 A F 5 A M 6 B M 7 A F
From this data I want to make select statement to produce report like this
_________________________
Gender
class M F Total
_________________________
A 2 3 5
B 1 1 2
_________________________
TOTAL 3 4 7
How can I make that select statement ?