If you have UNIQUE_ID on the table you can run the query:
Code:
Update TABLE1 SET FLAG = 'R'
Where unique_id in
(select unique_id from TABLE1
order by 1
fetch first 15 rows only)
And FLAG = 'N'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If not, you can use the unique combination the columns of the TABLE1:
Code:
Update TABLE1 SET FLAG = 'R'
Where (clmni1, clmni2,..., clmnik) in
(select clmni1, clmni2,..., clmnik from TABLE1
order by 1, 2, ..., k
fetch first 15 rows only)
And FLAG = 'N'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This code has to work.
I have tried it on my test table with perfect result.
Lenny