select
max(t."YEAR") "YEAR", max(t.QUARTER) QUARTER, max(t.DATETIME) DATETIME
from "test" t
where t."YEAR" =
( select max(t."YEAR") from "test" t )
AND t.QUARTER =
( select
max(t.QUARTER)
from "test" t
where t."YEAR" = ( select max(t."YEAR") from "test" t )
)