How to add sequential numbers to an existing table? I'm seeking your support as I'm new in using Toad.
I need to insert sequence numbers based on columns subno and AR_INVDATE.
So if the same subno has more than one AR_INVDATE then I need a sequential number based on sorting the AR_INVDATE in ascending order.
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.