SELECT a1.Name, a1.Sales, COUNT(a2.sales) +1 Sales_Rank FROM Total_Sales a1, Total_Sales a2 WHERE a1.Sales < a2.Sales GROUP BY a1.Name, a1.Sales ORDER BY a1.Sales DESC, a1.Name DESC
热心网友时间:2022-04-07 19:03
select name,sale,rank() over(order by sale desc) sales_rank from w_sales;