How to add sequential numbers to an existing table?
Generate the numbers:

select subno, ar_invdate, row_number() over (partition by subno order by ar_invdate) as num from first_second_bill_v4;


Update the table with these numbers:

merge into first_second_bill_v4 t1 using (select subno, ar_invdate, row_number() over (partition by subno order by ar_invdate) as num from first_second_bill_v4) t2 on (t1.subno = t2.subno and t1.ar_invdate = t2.ar_invdate)
when matched then update set t1.num = t2.num;


Theoretically, not tested.