Ver originalSELECT ta.tipo_agresion, SUM(IF (a.sexo = 0, 1,0)) Hombres, SUM(IF (a.sexo = 1, 1, 0)) Mujeres FROM alertas a INNER JOIN tipos_agresiones ta ON a.tAgrecion_Id = ta.id GROUP BY tAgrecion_Id