How to get second highest salary from a table

Answer Posted / srinivas

select * from emp m where(select count(distinct sal)+1 from emp s where s.sal>m.sal)=2

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two types of exceptions.

639


How can I change database name in sql?

533


What is equi join in sql?

617


What is sorting in sql?

505


Is record in pl sql?

517






Can we use joins in subquery?

539


What is data modelling in sql?

529


Can sql developer connect to db2?

587


Why do we use sql constraints? Which constraints we can use while creating database in sql?

551


explain the difference between myisam static and myisam dynamic. : Sql dba

519


Why do you partition data?

538


What does fetching a cursor do?

621


explain advantages of myisam over innodb? : Sql dba

609


What are the properties of a transaction?

573


Explain the types of joins in sql?

575