Использование подзапроса с аналитической функцией + левое соединение. Когда присоединился, тогда 'Y':
select case when cd.id is not null then 'Y' else 'N' end
from fntable fs
left join
( --group by cd.id, cd.s_id and filter
select cd.id, cd.s_id
from
( select max (cd.datetime) over (partition by dc.id) as max_id_datetime,
cd.id, cd.s_id, cd.datetime
from dfntable cd
) cd
where cd.datetime=max_id_datetime --filter only records with max date
group by cd.id, cd.s_id
) cd on fs.id = dfs.id and fs.s_id = dfs.s_id