
SELECT
  ('numéro '||courrier||' '||nom||' '||prenom) as destinataire,
  lettretype,
  to_char(datecourrier,'DD/MM/YYYY') as date

FROM
  &DB_PREFIXEcourrier_archive
  LEFT JOIN &DB_PREFIXEautorisation_archive on courrier_archive.destinataire=autorisation_archive.autorisation

WHERE
  courrier_archive.emplacement=&idx
;
