Suppose I have Oracle or Postgresql database.
ID IdExample OrderByColumn What I want
---------- ---------- ---------- ----------
1 1 1300 1
2 1 2450 1
3 2 5000 2
4 2 4800 2
5 1 5100 3
6 1 6000 3
7 4 7000 4
8 1 8000 5
How do count the changes that are in idExample, data is sorted by OrderByColumn I need output new column that is represented by "what I want" pay attention to "1" in IdExample. It repeats but I wants to iterate. The query should execute quickly with the table having tens of thousands of records.
THANKS