We used this query to assign batch id's to records based on rownum. A normal update wouldn't work because we needed a where clause.
merge into mrp_scalar_input e2
using (select etl_id, (trunc( (rownum-1) / (100) ) + 1) batchid from (select etl_id from mrp_scalar_input where type = 'x' order by etl_id) e0) e1
on (e2.etl_id = e1.etl_id)
when matched then
update set e2.batchid = e1.batchid