给你个参考:ORACLE取随机数的方法
    (1)、执行脚本$ORACLEHOME\RDBMS\ADMIN\catoctk.sql
    (2)、select ceil(dbms_random.value(1,4)) from dual;
    (3)、select * from scott.emp where rownum=trunc(dbms_random.value(1,50));
         (从表中选择随机行)

解决方案 »

  1.   

    select * from (select zyz2.*,dbms_random.random num from zyz2 order
    by num) where rownum<=10;但不明白是每段列出十个用户,还是从中抽出十个用户呢?
      

  2.   

    select a.*,b.* from (select zyz2.*,dbms_random.random num from zyz2 where col1>=1 and col1<=10 order by num) where rownum<=10) a,(select .......where col1>=11 and col2<=20 ....) b,........;
      

  3.   

    select 用户 from tab where rownum=round(dbms_random.value*10) and (话费>A and 话费<B)测试过了,可以一次选出 10 条数据,在大与A小于B的话费区间内,至于区间怎么分,就看你自己的了,
      

  4.   

    如果区间多,把以上 SELECT 语句多做几个UNION 就可以了,如果 CREATE 成VIEW 的话,以后用起来就更方便了
      

  5.   

    晕,你可以用VIEW 先把分区弄好,然后做个动态的 SQL ,SQL 的写法,就参照我上面的,就可以了呀,方法都告诉你了!
    如果你有什么更好的就贴出来大家共享!