I want to create a WINDOW
in PostgreSQL and get the row_number()
from a number until it appears again. As example, supposing I want to create a window from number 79 until 79 appears again and reset the counting, it must be like this:
number must be row_number number
50 ? 50
79 1 79
85 2 85
74 3 74
14 4 14
79 1 79
46 2 46
85 3 85
79 1 79
45 2 45
How I can do this?