select cityid, max(r)
from (select cityid, dbms_lob.substr(wm_concat(year) over (partition by cityid order by year)) as r from new_resources)
group by cityid;


select cityid, max(r)
from (select cityid, dbms_lob.substr(wm_concat(year) over (partition by cityid order by year)) as r from new_resources)
group by cityid;

