All,
How can I write a query to assign a rank of 1,2 or 3 to a table.
What I currently have is data like the example below
Route ID Price Vendor Rank
1 .005 X
1 .006 A
1 .007 C
1 .009 D
There are multiple Route IDs. What I need to do is assign and 1 to lowest price, 2 to the second lowest, etc by Route ID. So at each route id change it would rank 1,2,3 again. My table is currently in the proper order. Sorted by Route ID and then by Price. Yet we are loading this to a switch, so I need to identify the 3 lowest rates. This isnt the last step, just one in many that will based on the rank field.
How can I complete this. Any help is appreciated.
How can I write a query to assign a rank of 1,2 or 3 to a table.
What I currently have is data like the example below
Route ID Price Vendor Rank
1 .005 X
1 .006 A
1 .007 C
1 .009 D
There are multiple Route IDs. What I need to do is assign and 1 to lowest price, 2 to the second lowest, etc by Route ID. So at each route id change it would rank 1,2,3 again. My table is currently in the proper order. Sorted by Route ID and then by Price. Yet we are loading this to a switch, so I need to identify the 3 lowest rates. This isnt the last step, just one in many that will based on the rank field.
How can I complete this. Any help is appreciated.