Oracle随机查询数据

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/h1059141989/article/details/89209366
  • sample() 中的数据为总数据的百分比,取值范围在0.000001,99.999999之间,数据量大的时候,可增加效率
select *  from (select * from table_name sample(10)  
 order by trunc(dbms_random.value(0, 1000)))  where rownum < 4;
select * from (select * from table_name order by dbms_random.value) where rownum< 2;

猜你喜欢

转载自blog.csdn.net/h1059141989/article/details/89209366
今日推荐