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
How many tables can you join in sql?
what are the properties and different types of sub-queries? : Sql dba
What is sql*loader?
What are inner and outer joins examples of both?
What normalization means?
How do I save a stored procedure?
Can we insert data into materialized view?
What is AUTH_ID and AUTH_USER in pl/sql ?
What is aggregate function in sql?
what is the difference between clustered and non clustered index in sql? : Sql dba
Write a query to find the names of users that begin with "um" in sql?
what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba
What is nvl?
how to create a new table in mysql? : Sql dba
What are sql ddl commands?