select location_libelle as Localisation, section_libelle as Section, tdoc_libelle as Support,codestat_libelle as "Code statistique", arc_expl_cote as Cote, count(arc_id) as "Nombre de prêts" from pret_archive left join docs_type on arc_expl_typdoc=idtyp_doc left join docs_location on arc_expl_location=idlocation left join docs_section on arc_expl_section=idsection left join docs_codestat on arc_expl_codestat=idcode left join lenders on arc_expl_owner=idlender left join expl_custom_values on (arc_expl_id=expl_custom_origine and expl_custom_champ=3)  where arc_debut between '!!date1!!' and adddate('!!date2!!', INTERVAL 1 DAY) and expl_custom_date between '!!dateacq1!!' and adddate('!!dateacq2!!', INTERVAL 1 DAY) and arc_expl_owner in (!!choixproprio!!) and arc_expl_location in (!!choixlocation!!) and arc_expl_section in (!!choixsection!!) and arc_expl_typdoc in (!!choixtypdoc!!) and arc_expl_codestat in (!!choixcodestat!!) group by 1,2,3,4,5 order by 1,2,3,4