select 
service.libelle as service, service.adresse, service.cp, service.ville,
dossier.dossier,nature.libelle as nature,
demandeur_civilite, demandeur_nom, demandeur_societe,
demandeur_adresse, demandeur_cp, demandeur_ville,
terrain_numero, terrain_adresse, terrain_cp, terrain_ville,
terrain_surface,  hauteur, shon, shob, batiment_nombre, logement_nombre, 
to_char(date_depot,'DD/MM/YYYY')  as date_depot,
to_char(date_rejet,'DD/MM/YYYY')  as date_rejet,
travaux.libelle as travaux,
to_char(date_envoi,'DD/MM/YYYY')  as date_envoi
from consultation
inner join dossier on dossier.dossier=consultation.dossier
inner join service on service.service=consultation.service
inner join nature on nature.nature = dossier.nature
left join travaux on dossier.travaux=travaux.travaux
where consultation = &idx