I have a table with the following data
USER_ID | REVENUE
1 | 12,545
2 | 9,845
3 | 55,874
Is there a way for me to create a result with ranking on the fly within a view i.e.
USER_ID | REVENUE | RANK
3 | 55,874 | 1
1 | 12,545 | 2
2 | 9,845 | 3
I could try doing this by running a cron, but would like the result to be real-time - generated by MySQL in a view.
Any other alternatives welcome.