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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between update lock and exclusive lock?

583


Explain transaction server implicit?

615


Can you explain powershell included in sql server 2008?

595


What are types of subqueries?

638


Explain the use of containers in ssis and also their types?

610






Can you tell me about the concept of ER diagrams?

690


What is the difference between stored procedure and user defined functions?

720


What is the optimization being performed in oracle and SQL Server?

715


What is dml command?

621


What is the use of @@spid?

656


What is mapping schema?

670


What are the system database in sql server 2005?

641


How do I debug a stored procedure in sql server?

622


Define inner join? Explain with an example?

613


What is federation member?

103