select top 3 sal from each dept?

Answer Posted / shailesh j

SELECT * FROM (
SELECT DEPARTMENT_ID,SALARY,DENSE_RANK() OVER(PARTITION BY
DEPARTMENT_ID ORDER BY SALARY DESC) AS RK FROM EMPLOYEES)
WHERE RK<4;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are database links used for?

595


What is orm in sql?

539


Who is the owner of mysql database?

553


What is sql*loader and what is it used for? : aql loader

624


Is id a reserved word in sql?

666






what are the different index configurations a table can have? : Sql dba

575


what are all the different normalizations? : Sql dba

509


How can we make an if statement within a select statement?

543


What are % type and % rowtype?

576


What are aggregate functions in sql?

629


How do I pipe the output of one isql to another?

532


Inline the values in PL/SQL, what does it mean.?

633


what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba

673


how to include character strings in sql statements? : Sql dba

556


What is the difference between delete and truncate statement in sql?

497