Следуя вашим замечаниям, сделал новые тесты. Безуспешно ставлю остальную часть запроса.
WITH mnt AS (
select cast(mt.ID as numeric) as ID, cast(mt.ID1 as numeric) as ID1,
format_date(t.DATE_TOURNEE,'dd/MM/yyyy') as DATE_TOURNEE
FROM MR_P mt
LEFT JOIN RF_TOURNEE t ON mt.ID=t.ID
)
SELECT fc.ID as FC_ID,fc.IDENTIFIANT, mnt.ID as TOUR_ID, mnt.DATE_TOURNEE,max (mnt.DATE_TOURNEE) OVER (ORDER BY mnt.DATE_TOURNEE) DT_LAST_TOURNEE
FROM RF_Fiches fc
LEFT JOIN mnt ON fc.ID=mnt.ID1;
erreur sql