是rownum的问题,它总是从1开始.

解决方案 »

  1.   

    但是我用select MOD(rownum,10) from table_1能得到期望的结果呀
      

  2.   

    select没有问题.
    select * from table_1 where rownum = 2;同样是没有结果的.
      

  3.   

    SQL>  select rm,idno from (select rownum rm,idno from newsindex);        RM IDNO
    ---------- ------------
             1 0003
             2 0005
             3 0011
             4 0012
             5 0004
             6 0006
             7 0010
             8 0007
             9 0008
            10 0009
            11 0015
            12 0013
            13 0014
            14 0020
            15 0019
            16 002116 rows selectedSQL> select idno from (select rownum rm,idno from newsindex) where mod(rm,10)=3;IDNO
    ------------
    0011
    0014
      

  4.   

    declare
    cursor t_sor is
    select * from table_1
    num number:=1;
    begin
    for v_sor in t_sor loop
    if mod(num,10)=3 then
    update table_1 set column_1='111' where id=v_sor.id;
    end if
    num:=num+1;
    end loop;
    end;可以去掉declare做成一个过程.