Skip to content
Advertisement

Update sequence in table – Oracle

I have a table:

table1

I need to update my_seq if a new HI01 appears in the same u_a_id or the counter for HI changes, for ex. HI01 -> HI02 for each u_a_id order by line_num.

I have this query, however this gives seq as 1 even for second instance of HI01-01 in u_a_id = 1:

The output would look like:

Is there a way in Oracle SQL to achieve this?

Advertisement

Answer

I think you just want:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement