how to find the second highest salary from emp table?

Answer Posted / abhi

select max(sal)from emp where sal <> (select max(sal)from emp)

OR

select max(sal)from emp where sal < (select max(sal)from emp)

OR

select max(sal)from emp where sal != (select max(sal)from emp)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many tables can you join in sql?

533


what are the properties and different types of sub-queries? : Sql dba

506


What is sql*loader?

574


What are inner and outer joins examples of both?

497


What normalization means?

527






How do I save a stored procedure?

526


Can we insert data into materialized view?

517


What is AUTH_ID and AUTH_USER in pl/sql ?

1694


What is aggregate function in sql?

537


what is the difference between clustered and non clustered index in sql? : Sql dba

551


Write a query to find the names of users that begin with "um" in sql?

505


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

554


What is nvl?

613


how to create a new table in mysql? : Sql dba

548


What are sql ddl commands?

552