Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update only 20 rows

604058Jul 22 2008 — edited Jul 23 2008
I only want to update the first 20 rows in a table that match a certain condition. Here is the sql I have which is not working:

UPDATE random_numbers (SELECT ROWNUM, randomnum, flag FROM random_numbers where flag='N') SET flag = 'P' WHERE rownum < 2;

Here's the error I get:
ORA-00971: missing SET keyword

Any suggestions?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2008
Added on Jul 22 2008
5 comments
24,982 views