select ex.id_exploitation, ex.dateDebut, ex.dateFin, ex.nbRepresentations, ex.dateEtLieu, ex.scolaire, ex.creation, ex.dans_atelier, ex.type_lieu, r.nomRegion, r1.region_2016_label as region_2016, s.nom, s.adresse_l1, s.adresse_l2, s.codepostal, s.ville, s.tel, s.email, s.web, s.lat, s.lng, s.geolocalisation, s_fest.nom as nom_fest, s_fest.adresse_l1 as adresse_l1_fest, s_fest.adresse_l2 as adresse_l2_fest, s_fest.codepostal as codepostal_fest, s_fest.ville as ville_fest, s_fest.tel as tel_fest, s_fest.email as email_est, s_fest.web as web_fest, s_fest.lat as lat_fest, s_fest.lng as lng_fest, s_fest.geolocalisation as geolocalisation_fest from themaa_2.exploitation as ex left join themaa_2.regions as r on ex.region = r.idRegion left join themaa_2.regions_2016 as r1 on ex.region_2016 = r1.region_2016_id left join themaa_2.structure as s on s.structure_id = ex.id_lieu_permanent left join themaa_2.structure as s_fest on s_fest.structure_id = ex.id_festival where id_evenement_structure = 16 and ex.workflow = 1 and ex.dateFin < NOW() order by dateDebut descselect ex.id_exploitation, ex.dateDebut, ex.dateFin, ex.nbRepresentations, ex.dateEtLieu, ex.scolaire, ex.creation, ex.dans_atelier, ex.type_lieu, r.nomRegion, r1.region_2016_label as region_2016, s.nom, s.adresse_l1, s.adresse_l2, s.codepostal, s.ville, s.tel, s.email, s.web, s.lat, s.lng, s.geolocalisation, s_fest.nom as nom_fest, s_fest.adresse_l1 as adresse_l1_fest, s_fest.adresse_l2 as adresse_l2_fest, s_fest.codepostal as codepostal_fest, s_fest.ville as ville_fest, s_fest.tel as tel_fest, s_fest.email as email_est, s_fest.web as web_fest, s_fest.lat as lat_fest, s_fest.lng as lng_fest, s_fest.geolocalisation as geolocalisation_fest from themaa_2.exploitation as ex left join themaa_2.regions as r on ex.region = r.idRegion left join themaa_2.regions_2016 as r1 on ex.region_2016 = r1.region_2016_id left join themaa_2.structure as s on s.structure_id = ex.id_lieu_permanent left join themaa_2.structure as s_fest on s_fest.structure_id = ex.id_festival where id_evenement_structure = 16 and ex.workflow = 1 and ex.dateFin is not null and ex.dateFin >= NOW() order by ex.dateDebut asc

Sur le vif