Hello,
I am having trouble with a program I have written:
I create a table with an sql statement which has an order by clause on a numeric field. This way I am sure the records are sorted when inserted into the new table. I then use a DDL statement to add an autonumber field which will be used to rank the records "ALTER TABLE ADD rank AUTOINCREMENT"
So the result should be :
----------------------
item amount rank
----------------------
A 23 1
B 34 2
C 43 3
....
in some rare cases, the ranking isn't correct so I was wondering if I can trust this method of ranking or if there would be a better way.
I am having trouble with a program I have written:
I create a table with an sql statement which has an order by clause on a numeric field. This way I am sure the records are sorted when inserted into the new table. I then use a DDL statement to add an autonumber field which will be used to rank the records "ALTER TABLE ADD rank AUTOINCREMENT"
So the result should be :
----------------------
item amount rank
----------------------
A 23 1
B 34 2
C 43 3
....
in some rare cases, the ranking isn't correct so I was wondering if I can trust this method of ranking or if there would be a better way.