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 is a behavioral trigger?

513


How delete all records from table in sql?

548


how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba

766


How many databases can sql express handle?

530


How to fix oracle error ora-00942: table or view does not exist

567






Mention what problem one might face while writing log information to a data-base table in pl/sql?

674


Why do we use %rowtype & %type in plsql?

599


Which is better join or inner query?

514


what is single byte over head in oracle..?

1864


What is execute immediate?

548


is mysql query is case sensitive? : Sql dba

558


What is rowtype?

562


What is pl sql quora?

642


Why should I use postgresql?

561


Can we create table inside stored procedure?

532