select t.*
from tablename t
inner join (select t.xxx, max(DATE_TIME) date_time
from tablename1 t
group by t.xxx) n
on t.xxx = n.xxx
and t.date_time = n.date_time
where t.xxx in ('df', 'ff', 'dff')