Write a query to find second highest salary of an employee.

Answer Posted / sathish p

select e1.* from (select ename,sal,rank()
over(order by sal) rank from emp) e1
where e1.rank=2;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is rtm stands for?

574


What is bind variable in pl sql?

520


1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins

1144


What are the types of keys?

508


What are literals in sql server?

522






What is an invalid partition table?

556


How to connect a sql*plus session to an oracle server?

616


Which one is better subquery or joins?

550


What is natural join in sql?

531


how to select unique records from a table? : Sql dba

622


What is a temporal table?

488


How do I enable sql encryption?

516


Explain ddl statements in pl/sql?

571


Does truncate require commit?

537


How many tables can a sql database have?

527