select tdoc_libelle as Support, section_libelle as Section, statut_libelle as Statut, 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_statut ON idstatut=expl_statut LEFT JOIN docs_type ON idtyp_doc=expl_typdoc LEFT JOIN docs_section ON expl_section=idsection where a0.expl_custom_champ=2 and a1.expl_custom_origine=a0.expl_custom_origine and year(a1.expl_custom_date)='!!anneeacq!!' and expl_typdoc IN (!!supoort!!) and expl_section IN (!!sectionn!!) and expl_id=a1.expl_custom_origine group by Section, Statut, Support, a0.expl_custom_small_text