select top 3 sal from each dept?

Answer Posted / santo

SELECT r.salary, r.department_id, r.RANK highest
FROM (SELECT salary, department_id,
DENSE_RANK () OVER (PARTITION BY
department_id ORDER BY salary DESC)

RANK
FROM employees) r
WHERE r.RANK <= 3
ORDER BY 2

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is basic structure of pl sql?

502


How to sort the rows in sql.

603


What are the various restrictions imposed on view in terms of dml?

523


What is cost in sql execution plan?

490


what are the security recommendations while using mysql? : Sql dba

581






Explain scalar functions in sql?

585


What is the purpose of the primary key?

564


What is mutating error in pl sql?

553


What is sql select statement?

505


What is a null value?

657


Which column of the user triggers data dictionary view displays the database event that will fire the trigger?

595


Is left join same as join?

524


how to return query output in html format? : Sql dba

651


How does sql profiler work?

570


What are string functions in sql?

678