一、首先创建一个测试表
select * from DIM_IA_TEST1
生成随机数
select t.*,rownum rn from (select * from DIM_IA_TEST1 order by dbms_random.value())t;
随机取5条
select t.*,rownum rn from (select * from DIM_IA_TEST1 order by dbms_random.value())t where rownum<=5;
二、生成一个特定范围的随机数
以生成30~70范围随机数为例:
select dbms_random.value(30,70) from dual;