Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / omkar hendre

select distinct(sal) from emp a where 2=(select count(distinct(sal)) from emp b where a.sal <=b.sal)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I run a sql script?

519


what are the advantages a stored procedure? : Sql dba

553


What are actual parameters and formal parameters?

574


what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba

532


Explain clause in sql?

564






What is out parameter used for eventhough return statement can also be used in pl/sql?

588


How do you drop a trigger?

544


What is the use of prepared statement?

542


What are sql injection vulnerabilities?

500


Which one is better subquery or joins?

559


what is the command line end user interface - mysql? : Sql dba

507


Can a view be mutating? If yes, then how?

584


Is sql scripting language?

528


What is function and procedure in pl sql?

523


What is indexing in sql and its types?

548