Hi All,

I have problem with generating query with this simple set of data:

ID TIMESTAMP PART_NUMBER
------------------------------------
1 12:02:23 100
2 12:02:26 100
3 12:02:27 100
4 12:02:29 100
5 12:03:23 200
6 12:07:23 200
7 12:08:23 200
8 12:02:33 100
9 12:02:23 100

What I want to achieve is to add ranking column which count each set of data, but not directly groupped by all PART_NUMBER, but for groups od PART_NUMBER occuring each other, as follows (see PART_NUMBER: 100)

ID TIMESTAMP PART_NUMBER COUNT
----------------------------------------------
1 12:02:23 100 4
2 12:02:26 100 4
3 12:02:27 100 4
4 12:02:29 100 4
5 12:03:23 200 3
6 12:07:23 200 3
7 12:08:23 200 3
8 12:02:33 100 2
9 12:02:23 100 2