how to find the second highest salary from emp table?

Answer Posted / sankar sasmal

select distinct sal from emp e where 2=(select count(distinct sal)from emp s where e.sal<=s.sal)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define union, minus, union all, intersect ?

551


How can we find duplicate records in a table?

510


Why is sql*loader direct path so fast?

593


How do I tune a sql query?

510


How do I view an execution plan in sql?

525






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

543


Can sql developer connect to db2?

580


What type of database is sql?

613


What is memory optimized?

547


Is nosql faster than sql?

534


How can you view the errors encountered in a trigger?

544


What is lexical units in pl sql?

565


How to write html code in pl sql?

576


How can you select unique records from a table?

514


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

579