select expl_cb as "Code-barres", if(expl_notice>0,if(n1.tit4="",n1.tit1,concat(n1.tit1," : ",n1.tit4)),concat(nperio.tit1," / ",bulletin_numero)) as Titre, concat(author_name,", ",author_rejete) as Auteur, concat(empr_cb," : ",empr_nom,", ",empr_prenom) as Emprunteur, DATE_FORMAT(pret_date, "%d/%m/%Y") as "Date de prêt", DATE_FORMAT(pret_retour, "%d/%m/%Y") as "Date de retour prévu" from pret left join exemplaires on pret_idexpl=expl_id left join notices n1 on expl_notice=n1.notice_id left join responsability on responsability_notice=n1.notice_id and responsability_type=0  left join authors on author_id=responsability_author left join bulletins on expl_bulletin=bulletin_id left join notices nperio on bulletin_notice=nperio.notice_id left join empr on id_empr=pret_idempr where empr_location in (!!localisation!!) order by pret_retour ASC, empr_nom ASC, empr_prenom ASC