You can reframe this query:
Code: Select all
Select Account_id, Max(To_date(Substr(period_name,-6),'MON-YY')) PERIOD from GLFV_ACTUAL_BALANCES
where account_id = 1100
group by account_id
Only thing you will have problem in Adj-Dec-07, Adj-Dec-08 values..
Regards,
Senthil K