select libelle as 'Code statistique', case when empr_sexe='1' then 'Hommes' when empr_sexe='2' then 'Femmes' else 'indéterminé' end as Sexe, count(id_empr) from empr left join empr_codestat on empr_codestat=idcode group by libelle,sexe order by libelle