assigning a rank based on total sales
- by Nathaniel_613
I need to create a field called “rank”, that ranks each part ID based on total sales, by assigning a sequential number based on total sales, where the higher the total sales, then the lower the rank value. For example, the part ID with the most sales would have a rank value of “1” and the part ID with the next highest sales would have a rank value of “2” and the part ID with the lowest sales would rank with the highest number.
If 2 different parts ID’s have the same total sales, then it is OK if they share the same rank.
Please provide me the SQL to copy and paste
Thank you very much in advance, Nathaniel
SELECT qry_rank_01.[total sales amount], qry_rank_01.PART_ID
FROM qry_rank_01;