I try to get this in single query but failed.
Do we need to use group set?

| colA |
| --- |
| 200 |
| 400 |
| 300 |
| 500 |
| 200 |

transform into

| colA | colB |
| --- | --- |
| 200 | 1 |
| 300 | 2 |
| 300 | 2 |
| 400 | 3 |
| 500 | 4 |