with menu(OID, code ,pcode,appid)as(
select t.MENU_ID,t.MENU_CODE,t.P_MENU_CODE ,t.APP_ID from s1.EAI_SSO_APPMENU_TD t
where t.MENU_ID='APP00100010'
union all
select t.MENU_ID,t.MENU_CODE,t.P_MENU_CODE ,t.APP_ID from s1.EAI_SSO_APPMENU_TD t ,menu m
where t.MENU_CODE=m.pcode
)
select t.* from menu m ,EAI_SSO_APPMENU_TD t where m.oid=t.MENU_ID order by t.MENU_CODE
select t.MENU_ID,t.MENU_CODE,t.P_MENU_CODE ,t.APP_ID from s1.EAI_SSO_APPMENU_TD t
where t.MENU_ID='APP00100010'
union all
select t.MENU_ID,t.MENU_CODE,t.P_MENU_CODE ,t.APP_ID from s1.EAI_SSO_APPMENU_TD t ,menu m
where t.MENU_CODE=m.pcode
)
select t.* from menu m ,EAI_SSO_APPMENU_TD t where m.oid=t.MENU_ID order by t.MENU_CODE