top 5 salary in each department by sql query
  • Hi before few days in interview i asked question like who to get top 5 max salary from each department.
    So i want to share query for this.

    Solution

    SELECT * FROM
    (
    select ROW_NUMBER() OVER(PARTITION BY Department ORDER BY Salary DESC) Row, Department, Salary  From TableName
    ) T
    Where Row <=5


Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Tagged

Popular Posts of the Week

Top Posters Weekly

Optimum Creative