Statement to set order_id of columns? Hi,
I'm running MySQL 5.0 on Fedora Core 6 Linux. Currently I have a
table with rows and values like
ID ORDER_ID
-----------------------------
1 1
2 3
3 5
8 5
9 7
11 15
12 15
30 18
I would like to write some UPDATE statement that sets the order IDs in
some consecutive fashion and if there are two order ids with the same
value, the row with the higher key ID would get the higher order id.
So, if I ran the statement against the above data, I would want
results like
ID ORDER_ID
-----------------------------
1 1
2 2
3 3
8 4
9 5
11 6
12 7
30 8
Any ideas how to do this? Thanks, - Dave |