select section_libelle as Section, tdoc_libelle as Support, a0.expl_custom_small_text as Type,count(distinct a1.expl_custom_origine) as Total from expl_custom_values as a0, expl_custom_values as a1, exemplaires left join docs_type on expl_typdoc=idtyp_doc LEFT JOIN docs_section ON idsection=expl_section where a0.expl_custom_champ=2 and a1.expl_custom_champ=3 and date_format(a1.expl_custom_date,'%Y')='!!annee!!' and a1.expl_custom_origine=a0.expl_custom_origine and expl_id=a1.expl_custom_origine and expl_section in (!!section!!) and expl_typdoc IN (!!suppoort!!) group by a0.expl_custom_small_text, Support, Section ORDER BY Section, Support