how to find the second highest salary from emp table?

Answer Posted / gurvinder

select max(sal)from emp where sal in(select sal from emp minus select max(sal) from emp);

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sharding in sql?

572


Describe sql comments?

567


what is the difference between primary key and unique key? : Sql dba

537


Is mariadb nosql?

598


How do you update sql?

528






which tcp/ip port does sql server run on? : Sql dba

525


What is the difference between a subquery and a join?

539


How to call shell script from pl sql procedure?

639


Is grant a ddl statement?

459


What is the current version of sql?

547


How do I debug a stored procedure?

639


What is the difference between partition and index?

493


explain commit and rollback in mysql : sql dba

554


What are pl sql data types?

555


Is primary key an index?

545