select if(id_type_abt is null,'Type abonnement supprimé',type_abt_libelle) as "Type d'abonnement", count(distinct arc_id) as "Nombre de prêts" from pret_archive left join empr on arc_id_empr=id_empr left join type_abts on type_abt=id_type_abt where arc_id_empr!=0 and arc_debut between "!!date1!!" and "!!date2!!" group by 1 order by 1