select * from (select id1,id2 from
( select distinct
row_number() OVER(PARTITION BY ob.id ORDER BY ob.id) n,
SYS_GUID() as id1,
ob.id as id2
from EN_ACCEPTEDRESULT ob
left join MONITORRULES m
on m.businessenterprise = ob.app_type
and ob.bus_type = m.typeofservice
left join MONITORSUPERVISE s
on s.enid = ob.id
LEFT JOIN T_EN_APP_APPLICATION@BMRPDBLINK TEAA
on TEAA.id = ob.id
LEFT JOIN T_EN_APP_BASEINFO@BMRPDBLINK TEAB
ON TEAA.EN_APP_BASEINFO_ID = TEAB.ID
left JOIN T_PUB_PARAMETER@BMRPDBLINK TPP
ON TEAB.SUPERIOR_DEPT = TPP.PARAM_CODE
where ob.approval_date is not null
) sa where n = 1 order by dbms_random.value )
( select distinct
row_number() OVER(PARTITION BY ob.id ORDER BY ob.id) n,
SYS_GUID() as id1,
ob.id as id2
from EN_ACCEPTEDRESULT ob
left join MONITORRULES m
on m.businessenterprise = ob.app_type
and ob.bus_type = m.typeofservice
left join MONITORSUPERVISE s
on s.enid = ob.id
LEFT JOIN T_EN_APP_APPLICATION@BMRPDBLINK TEAA
on TEAA.id = ob.id
LEFT JOIN T_EN_APP_BASEINFO@BMRPDBLINK TEAB
ON TEAA.EN_APP_BASEINFO_ID = TEAB.ID
left JOIN T_PUB_PARAMETER@BMRPDBLINK TPP
ON TEAB.SUPERIOR_DEPT = TPP.PARAM_CODE
where ob.approval_date is not null
) sa where n = 1 order by dbms_random.value )