PHV,
In my case, the rank only changes once a month. The prices are good for an entire month.
Also, I have tried the above it runs terribly slow. My table is some 5.2 million records.
Originally my table had 401,000 rows with each vendor in its own column. What I was truly trying to accomplish was to rank each row across multiple columns. Similar to Excel's Rank Function. But I have not been able to find anyway to do it. I was given advice by many people to normalize the data, to which I did via a union query. I then used that to make a table with all the Vendors, Regions and Prices.
I tried the above Ranking method but it takes far far to long for it to complete. The reason I actually need a Ranking Number is for routing in a switch. It needs a number to key off of. See I can have up to ten routes per region and we base our routing on rate. So we route the least cost rate first, then the second least cost rate and so on.
I saw the posting above and figured I would give it a try being the other example of using the query takes forever to run. And I am running a 3ghz machine with plenty of ram. And the database is located on the machine.
Any thoughts, suggestions are more then welcome