select service.libelle as service_libelle, service.adresse as service_adresse, service.cp as service_cp, service.ville as service_ville, consultation.dossier as dossier, travaux.libelle as libelle_travaux,
demandeur_civilite,date_demande, demandeur_nom, demandeur_adresse, demandeur_cp, demandeur_ville, terrain_adresse
from  consultation inner join service on service.service = consultation.service inner join dossier on dossier.dossier =consultation.dossier left join travaux on travaux.travaux = dossier.travaux

where  consultation= &idx