Skip to content
Advertisement

Adding a row number respecting the order of each row

I have a table like this

I would like to add a new column with a ranking, respecting the order of the row given my column ‘period’ to obtain something like this

What can I do?

I try rank and dense_rank function without any success

Advertisement

Answer

And another candidate for CONDITIONAL_CHANGE_EVENT() less code, and quite effective, too …!

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