(select code_value_name from sys_code_values_v,csh_margin_check t1 where code='MARGIN_CHECK_STATUS' and code_value = t1.MAR_AFTER_STATUS) mar_after_status_n
from (select t.mar_after_status from csh_margin_check t where t.wfl_status='APPROVED' order by t.creation_date desc) where rownum=1
SELECT Mar_After_Status AS Mar_Status,
(SELECT Code_Value_Name
FROM Sys_Code_Values_v, Csh_Margin_Check T1
WHERE Code = 'MARGIN_CHECK_STATUS'
AND Code_Value = T1.Mar_After_Status
AND t.Margin_Check_Id = T1.Margin_Check_Id) Mar_After_Status_n