1、首先建立一個測試表dom
select * from DIM_IA_TEST1測試
生成隨機數blog
select t.*,rownum rn from (select * from DIM_IA_TEST1 order by dbms_random.value())t;隨機數
隨機取5條select
select t.*,rownum rn from (select * from DIM_IA_TEST1 order by dbms_random.value())t where rownum<=5;im
2、生成一個特定範圍的隨機數db
以生成30~70範圍隨機數爲例:img
select dbms_random.value(30,70) from dual;co