I have a problem with the following query
SELECT h.sexo,
h.universidad,
count(*) as TOTALES,
SUM(CASE WHEN h.universidad = 'Latina' THEN 1 ELSE 0 END) AS number,
SUM(CASE WHEN h.universidad = 'UAM' THEN 1 ELSE 0 END) AS numbers
from citas as u
join pacientes as h
on u.cedulaFK = h.cedula
AND u.fecha_cita >= '$fecha1' and u.fecha_cita <= '$fecha2'
where u.cod_sedeFK = 1
ORDER BY h.sexo
I want to show the number of citations by sex or gender, in addition to the university to which they belong. But he's just showing me the number of one-sex citations, omitting the others.