select location_libelle as Localisation, section_libelle as Section, tdoc_libelle as Support, codestat_libelle as "Code statistique",arc_expl_cote as Cote, if(arc_expl_bulletin!=0,concat(if(bulletin_id is null,'Bulletin supprimé',perio.tit1),' ',bulletin_numero,' ',mention_date,' ',bulletin_titre),if(mono.notice_id is null,'Titre supprimé',mono.tit1)) as Titre,if(a0.author_id is not null,CONCAT(a0.author_name, ' ', a0.author_rejete),'') as 'Auteur principal', ed_name As Editeur,date_format(expl_custom_date,'%d-%m-%Y') as "Date acquisition",if(categories.num_noeud is null,'',GROUP_CONCAT(distinct concat('[',libelle_thesaurus,']',libelle_categorie) SEPARATOR ', ')) as 'Catégorie', count(distinct arc_id) as 'Nombre de prêts dans la période' from pret_archive left join notices as mono on arc_expl_notice=mono.notice_id left join bulletins on arc_expl_bulletin=bulletin_id left join notices as perio on bulletin_notice=perio.notice_id left join notices_categories on mono.notice_id=notcateg_notice left join categories on (notices_categories.num_noeud=categories.num_noeud and categories.langue='fr_FR') left join thesaurus on categories.num_thesaurus=id_thesaurus left join publishers on mono.ed1_id=ed_id left join responsability as r0 on (mono.notice_id=r0.responsability_notice and r0.responsability_type=0) left join authors as a0 on a0.author_id=r0.responsability_author left join docs_location on arc_expl_location=idlocation left join docs_section on arc_expl_section=idsection left join docs_type on arc_expl_typdoc=idtyp_doc 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('!!date2acq!!', 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 (!!choixsupport!!) and arc_expl_codestat in (!!choixcodestat!!) group by mono.notice_id order by 1,2,3,4