select codestat_libelle as 'Code statistique', count(distinct expl_id) as 'Livres Imprimés : Total Unités Matérielles Eliminées' from exemplaires left join notices on expl_notice=notice_id left join docs_codestat on expl_codestat=idcode left join lenders on expl_owner=idlender left join expl_custom_values as datepilonnage on (expl_id=datepilonnage.expl_custom_origine and datepilonnage.expl_custom_champ in (select idchamp from expl_custom where name="date_pilon")) left join docs_location on expl_location=idlocation where expl_location in (!!choixlocation!!) and expl_owner=!!choixproprio!! and expl_statut=!!choixstatutpilon!! and expl_notice!=0 and typdoc='a' and niveau_biblio='m' and year(datepilonnage.expl_custom_date)=!!annee!! group by 1 order by 1;
select codestat_libelle as 'Code statistique', count(distinct expl_id) as 'Publications en série imprimées : Total Unités Matérielles Eliminées' from exemplaires left join bulletins on expl_bulletin=bulletin_id left join notices on bulletin_notice=notice_id left join docs_codestat on expl_codestat=idcode left join lenders on expl_owner=idlender left join docs_statut on expl_statut=idstatut left join expl_custom_values as datepilonnage on (expl_id=datepilonnage.expl_custom_origine and datepilonnage.expl_custom_champ in (select idchamp from expl_custom where name="date_pilon")) left join docs_location on expl_location=idlocation where  expl_location in (!!choixlocation!!) and expl_owner=!!choixproprio!! and expl_statut=!!choixstatutpilon!! and expl_bulletin!=0 and niveau_biblio='s' and year(datepilonnage.expl_custom_date)=!!annee!! group by 1 order by 1;