Find top Nth employee from each department in terms of
salary?

Answers were Sorted based on User's Feedback



Find top Nth employee from each department in terms of salary?..

Answer / khushboo

select top 1 emp_name,emp_sal from employee order by emp_sal
desc

Is This Answer Correct ?    0 Yes 2 No

Find top Nth employee from each department in terms of salary?..

Answer / madhu

select top 1 salary,employee from (table name) group by
department

Is This Answer Correct ?    10 Yes 13 No

Find top Nth employee from each department in terms of salary?..

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

Post New Answer

More SQL Server Interview Questions

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?

0 Answers  


How do I find the port number for sql server?

0 Answers  


How To Make password Protected SQL Server 2005 Database i.e when i open SQL Server database then ask for password.

1 Answers  


What is the difference between a stored procedure and a user defined function?

0 Answers  


what is trigger . hw will it use them

2 Answers   TCS,






What are the new scripting capabilities of ssms? : sql server management studio

0 Answers  


what are defaults? : Sql server database administration

0 Answers  


Creating Tables Using SELECT

1 Answers  


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?

2 Answers  


How much does sql server 2016 cost?

0 Answers  


explain different types of joins? : Sql server database administration

0 Answers  


Alternative way to DetDate() function?

5 Answers  


Categories