Daniel Techen
June 10th, 2005, 11:51 AM
Hi folks,
today I spent a full hour trying to write a "simple" SQL SELECT:sick: . There is a table that has a column "position". The table looks like this:
SELECT RowNum, Position FROM myTable
RowNum Position
--------------------------
1 2a
2 2a
3 2a
4 2b
5 3a
6 3a
...
What I need is a SQL Select that does not retrieve a consecutive rownum, but a "rownum per position". The result table should look like this:
Position "RowNum"
--------------------------
2a 1
2a 2
2a 3
2b 1
3a 1
3a 2
I hope you got my point ;-). Can anybody give me a hint how to achieve this?
TIA,
Daniel
BTW. The DBMS is an Oracle.
today I spent a full hour trying to write a "simple" SQL SELECT:sick: . There is a table that has a column "position". The table looks like this:
SELECT RowNum, Position FROM myTable
RowNum Position
--------------------------
1 2a
2 2a
3 2a
4 2b
5 3a
6 3a
...
What I need is a SQL Select that does not retrieve a consecutive rownum, but a "rownum per position". The result table should look like this:
Position "RowNum"
--------------------------
2a 1
2a 2
2a 3
2b 1
3a 1
3a 2
I hope you got my point ;-). Can anybody give me a hint how to achieve this?
TIA,
Daniel
BTW. The DBMS is an Oracle.