declare num number(10):=0; select rownum into num from (select id,rownum from tablename order by id); if(mod(num,7) == 0) then update tablename set xxxx = '99' where 行数是7倍数的数据; end if; commit;路过!!
begin for idx in (select 主键,rownum from tablename ) loop if mod(idx.rownum,7)=0 then update tablename set xxxx = '99' where 主键= idx.主键; end if; end loop; end;个人认为这样定义条件来更新数据是有问题的,不推荐
select rownum into num
from
(select id,rownum from tablename order by id);
if(mod(num,7) == 0) then
update tablename set xxxx = '99' where 行数是7倍数的数据;
end if;
commit;路过!!
for idx in (select 主键,rownum from tablename ) loop
if mod(idx.rownum,7)=0 then
update tablename set xxxx = '99' where 主键= idx.主键;
end if;
end loop;
end;个人认为这样定义条件来更新数据是有问题的,不推荐