select codestat_libelle as 'Code statistique', count(distinct expl_id) as 'Livres Imprimés : Total Unités Matérielles' 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 docs_location on expl_location=idlocation where expl_location in (!!choixlocation!!) and expl_owner=!!choixproprio!! and expl_notice!=0 and typdoc='a' and niveau_biblio='m' group by 1 order by 1;
select codestat_libelle as 'Code statistique', count(distinct expl_id) as 'Dont Unités Matérielles en Libre Accès (Livres Imprimés)' 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 docs_statut on expl_statut=idstatut left join docs_location on expl_location=idlocation where  expl_location in (!!choixlocation!!) and expl_owner=!!choixproprio!! and expl_notice!=0 and typdoc='a' and niveau_biblio='m' and pret_flag=1 group by 1 order by 1;
select codestat_libelle as 'Code statistique', count(distinct notice_id) as 'Livres Imprimés : Total Titres' 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 docs_statut on expl_statut=idstatut left join docs_location on expl_location=idlocation where expl_location in (!!choixlocation!!) and  expl_owner=!!choixproprio!! and expl_notice!=0 and typdoc='a' and niveau_biblio='m' group by 1 order by 1;
select codestat_libelle as 'Code statistique', count(distinct expl_id) as 'Dont Unités Matérielles publiées avant 1811' 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 docs_location on expl_location=idlocation where expl_location in (!!choixlocation!!) and expl_owner=!!choixproprio!! and expl_notice!=0 and typdoc='a' and niveau_biblio='m' and year REGEXP '^[0-9]' and year NOT REGEXP '[[:alpha:]]' and year < 1811 group by 1 order by 1;
select codestat_libelle as 'Code statistique', count(distinct expl_id) as 'Dont Unités matérielles publiées entre 1811 et 1914' 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 docs_location on expl_location=idlocation where expl_location in (!!choixlocation!!) and  expl_owner=!!choixproprio!! and expl_notice!=0 and typdoc='a' and niveau_biblio='m' and year REGEXP '^[0-9]' and year NOT REGEXP '[[:alpha:]]' and year>=1810 and year<=1914 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' 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_location on expl_location=idlocation where expl_location in (!!choixlocation!!) and expl_owner=!!choixproprio!! and expl_bulletin!=0 and niveau_biblio='s' group by 1 order by 1;
select codestat_libelle as 'Code statistique', count(distinct expl_id) as 'Dont Unités Matérielles en Libre Accès (Publications en série imprimé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 docs_location on expl_location=idlocation where expl_location in (!!choixlocation!!) and expl_owner=!!choixproprio!! and expl_bulletin!=0 and niveau_biblio='s' and pret_flag=1 group by 1 order by 1;
select codestat_libelle as 'Code statistique', count(distinct notice_id) as 'Publications en série imprimées : Total Titres de Périodiques' 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_location on expl_location=idlocation where expl_location in (!!choixlocation!!) and expl_owner=!!choixproprio!! and expl_bulletin!=0 and niveau_biblio='s' group by 1 order by 1;