Update x
set x.foo = 'hello'
where rownum <= 500;
This way, Oracle will only update the first 500 records it finds.
You can use rownum in virtually any DML statement. Try it on a select statement:
select x.foo
from x
where rownum <= 10;
Your result set will only have the first 10 records displayed on the screen.
No comments:
Post a Comment