adspace


Query for second maximum salary in each in each department

Answer Posted / ram

SELECT empno,salary,dept_id FROM (SELECT empno,salary,dept_id,DENSE_RANK() OVER (PARTITION BY Dept_id ORDER BY Salary DESC)
as Rnk FROM emp) WHERE Rnk = 2;

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do we need to rebuild index after truncate?

1141


what is collation? : Sql dba

1229


Is primary key always clustered index?

1096


Is primary key clustered index?

1020


Is inner join faster than left join?

1278


If a cursor is open, how can we find in a pl/sql block?

1239


how to start mysql server? : Sql dba

1268


Can we use distinct and group by together?

1134


What is your daily office routine?

2347


Can we rollback truncate?

1074


how to use regular expression in pattern match conditions? : Sql dba

1113


How do I remove duplicates in two columns?

1188


define sql insert statement ? : Sql dba

1098


how to escape special characters in sql statements? : Sql dba

1115


What is the best sql course?

1050