I have a table with some repeated values in a field.
- Is it possible to assign some order value to the repeated values by creating a new field with values starting at one and consecutive integers for each repeated value? No predetermined order is necessary.
- Is it possible to establish an order related, for example, to the value of the X coordinates (minimum x=1, second minimum x=2...)
initial TABLE required TABLE
id ref id ref order
35 A 35 A 1
36 A 36 A 2
37 A 37 A 3
38 B 38 B 1
39 C 39 C 1
40 C 40 C 2
initial TABLE required TABLE
id ref x_coord id ref x_coord order
35 A 5 35 A 5 2
36 A 3 36 A 3 1
37 A 10 37 A 10 3
38 B 7 38 B 7 1
39 C 5 39 C 5 1
40 C 8 40 C 8 2