oracle随机取number条满足条件的数据

select id
from T_CLOUD_BUY_NUMBER m
where m.act_id = #{actId}
and nvl(m.user_id, 0) = 0
order by dbms_random.value)
where rownum <= #{number}

原文地址:https://www.cnblogs.com/hpp0716/p/6933940.html