Write a query to find second highest salary of an employee.
Answers were Sorted based on User's Feedback
Answer / preetir
select min(sal) from (select distinct sal from emp order by
desc where rownum < 2)
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / arif saulat
select * from emp where sal <(select max(sal) from emp)
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / deepshikha
SELECT MAX (sal)
FROM emp a,
(SELECT MAX (sal) max_sal
FROM emp) abc
WHERE a.sal < abc.max_sal
ORDER BY sal DESC;
Is This Answer Correct ? | 0 Yes | 3 No |
Answer / vamana murthy
select ename,salary from emp
where rownum=2
order by salary desc
Is This Answer Correct ? | 0 Yes | 7 No |
Use the below Query:
Select Max(salary) from Emp
Where Max(salary) < (Select Max(salary) from emp
where emp-no=101);
Is This Answer Correct ? | 10 Yes | 18 No |
Answer / kitcat
SELECT salary
FROM (SELECT salary FROM emp
ORDER BY DESC salary)
WHERE RowNum=2
Is This Answer Correct ? | 1 Yes | 11 No |
Explain autonomous transaction.
What is the process of debugging?
Can we create foreign key without primary key?
wa procedure to return the month and the no'f developers joined in each month.
what is the Default Libraries for Oracle Report 6i
Why having clause is used in sql?
Can delete statement be rollbacked?
What is partition by in sql?
If you have to declare procedure1,procedure2 in package specification and if you have to declare procedure1,procedure2 and procedure3 in package body? is it compilation or not and execute or not? what type of error is given please
What is left join example?
explain the difference between delete , truncate and drop commands? : Sql dba
what is a constraint? : Sql dba