I am really confused how to write query for the following statement.
How to display top 5 employees with the highest number of sales (total) and display position as a field. Note that if both of employees have the same total sales values they should receive the same position, in other words Top 5 employees might return more than 5 employees?
Anyone can suggest an answer for this?
Something like:
I re-read your question and it seems that you’re looking for the top count of sales rather than sum of salary, but of course, in that case you can just use
COUNT(sales)in the OVER statement.