Write a query to find second highest salary of an employee.
Answer Posted / humayun quaiser
slect max(sal) from emp
where sal not in (select max(sal) from emp);
or
select max(sal) from emp
where sal<(select max(sal) from emp);
or
select distinct sal from emp e
where 1=(select count(distinct sal) from emp
where sal>e.sal);
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What type of join is sql join?
How many types of index are there?
List out the acid properties and explain?
what are the differences between require and include, include_once and require_once? : Sql dba
what is csv? : Sql dba
What are the two types of exceptions in pl/sql?
How is a process of pl/sql compiled?
What is nvarchar max in sql?
what is query cache in mysql? : Sql dba
What is database sql?
What are the different operators available in sql?
What is the file extension for sql database?
what is an extent ? : Sql dba
How many databases can sql express handle?
What is primary key and foreign key?