Find top Nth employee from each department in terms of
salary?
Answers were Sorted based on User's Feedback
Answer / khushboo
select top 1 emp_name,emp_sal from employee order by emp_sal
desc
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / madhu
select top 1 salary,employee from (table name) group by
department
Is This Answer Correct ? | 10 Yes | 13 No |
Answer / suri
select max(m.total_amt),e.emp_name, d.dept_name from
hr_employee_salary_mst m,
hr_employee_mst e, hr_dept_table d
where d.dept_id=e.dept_id
and m.employee_id=e.emp_id
group by d.dept_name,e.emp_name,d.dept_name
Is This Answer Correct ? | 3 Yes | 7 No |
How many files can a database contain in sql server?how many types of data files exists in sql server? How many of those files can exist for a single database?
How do I find the port number for sql server?
How To Make password Protected SQL Server 2005 Database i.e when i open SQL Server database then ask for password.
What is the difference between a stored procedure and a user defined function?
what is trigger . hw will it use them
What are the new scripting capabilities of ssms? : sql server management studio
what are defaults? : Sql server database administration
Creating Tables Using SELECT
Well sometimes sp_reanmedb may not work you know because if some one is using the db it will not accept this command so what do you think you can do in such cases?
How much does sql server 2016 cost?
explain different types of joins? : Sql server database administration
Alternative way to DetDate() function?