Query for second maximum salary in each in each department

Answer Posted / gopinath

select department_id, salary from
(select department_id, salary, rank() over(partition by
department_id order by salary desc) r from employees) where r=2;



cheers;

Is This Answer Correct ?    35 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pl sql procedures?

514


1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao...

1912


What are the three pl sql block types?

571


What is sql table?

520


What are the possible values that can be stored in a boolean data field?

515






How do you rename a table in sql?

532


What is user in sql?

577


How can use stored procedures in sql?

580


Why do we create stored procedures & functions in pl/sql and how are they different?

502


Is sql port 1433 encrypted?

576


What are different types of triggers?

555


How do I save the results of sql query in a file?

535


Can we write ddl statements in functions?

564


What is asqueryable?

531


What is graph sql?

524