Using RANK Function
Rank rows by grouping data.
Last updated:
Warning: Review and test in a non-production environment before running.
SELECT a.*, RANK() OVER(PARTITION BY Name ORDER BY Name,SellStartDate desc) AS [rank]
from ( SELECT Name,ReorderPoint,SellStartDate FROM Production.Product) as a order by 1,4 desc