I have a table that has groups of records and I want to save order in the table for those records, for e.g.
==========================
group_id | bid | rank
==========================
1 | 10 | ?
1 | 12 | ?
2 | 4 | ?
2 | 5 | ?
2 | 3 | ?
==========================
Is there some query I can use to save the rank in the above table with the order of bids, so the result becomes
==========================
group_id | bid | rank
==========================
1 | 10 | 1
1 | 12 | 2
2 | 4 | 2
2 | 5 | 3
2 | 3 | 1
==========================