'How to display rank in MySQL 5.7 without using rank() and partiotion

Convert to mysql5.7 Select category, brands, revenue, Rank() over (partition by category order by revenue) 'rank' From task.ranking Order by category



Solution 1:[1]

One solution would be to create a temporary table and compile the rank using a looping cursor with a greater-than comparison and then storing the result in a variable for display once the loop concludes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MAbraham1