select * from tb where rownum<=(select count(*) from tb)*0.25;

解决方案 »

  1.   

    select * from tb where rownum <=(select count(*)/4 from tb) oracle就没有top xx% persent-_-||
      

  2.   

    select * from tb where rownum <=(select count(*) from tb)*0.25; 
    select * from tb where rownum <=(select count(*)/4 from tb) ;
    select * from tb where rownum <=(select count(*) from tb)/4; 
    都可以。
      

  3.   


    select * from tb where rownum <=(select count(*)/4 from tb) ; 绝对正确!
      

  4.   


    select * from tb where rownum <=(select count(*) from tb)*0.25; 
    select * from tb where rownum <=(select count(*)/4 from tb) ; 
    select * from tb where rownum <=(select count(*) from tb)/4; 
    实践后才能知道真的行不行!大家都试试!
      

  5.   

    SELECT * FROM tableA WHERE ROWNUM<=(select count(*)/4 from tableA);
      

  6.   

    SELECT * FROM tableA WHERE ROWNUM<=(select count(*)/4 from tableA);
      

  7.   

    select * from table1 sample (25)
    这个只是个大概的比例,不是准确的
      

  8.   

    是怎样的前25%先,是按ID排序?name排序?age排序?
    而且为什么要25%???一个固定数不是很好吗?