how to find the second highest salary from emp table?

Answer Posted / vinod dubey

select * from emp
where sal = (select max(sal) from emp where sal <>(select max(sal) from emp));

it will defiantly work

best of luck

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is PL/SQL Records?

630


Which command is used to delete a package?

578


What are different types of sql commands?

515


Is json a nosql?

541


What is the file extension for sql database?

519






What is the maximum rows in csv?

491


how mysql optimizes distinct? : Sql dba

555


Does inner join remove duplicates?

524


Is sql easier than java?

528


What is an intersect?

657


does sql support programming? : Sql dba

611


How to fetch alternate records from a table?

684


How to make a copy values from one column to another in sql?

579


Which sorts rows in sql?

587


how to present a past time in hours, minutes and seconds? : Sql dba

568