abes_nitya Posted August 11, 2006 Share Posted August 11, 2006 My question is about sql query: suppose that there is emp table which contain column name as empname,empno, sal etc.we want to find "nth maximum salary of an employee". by SQL query.byethanks Link to comment Share on other sites More sharing options...
Reg Edit Posted August 11, 2006 Share Posted August 11, 2006 we want to find "nth maximum salary of an employee"Not 100% sure what you mean, but this will find the top n salaries if that's what you want:SELECT TOP n salFROM empGROUP BY salORDER BY sal DESC; Hope this helps. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now