select empr_codestat.libelle as 'Code statistique', count(distinct id_empr) as 'Total lecteurs actifs' from empr left join empr_categ on empr_categ=id_categ_empr left join empr_codestat on empr_codestat=idcode left join docs_location on empr_location=idlocation where (year(empr_date_adhesion)=!!annee!! or year(empr_date_expiration)=!!annee!!) and empr_location in (!!choixlocation!!) and empr_categ in (!!choixcateg!!) group by 1 order by 1