1.how to extract the second highest salary from emp table
having sal as a column which contains the salary of all
employee of an organisation.
Answers were Sorted based on User's Feedback
Answer / ramya
select max(sal) from employees where
sal < (select max(sal) from employees)
| Is This Answer Correct ? | 21 Yes | 2 No |
Answer / neha k
select sal
from (SELECT sal, rownum row_num
FROM emp
order by sal desc)
where row_num = 2;
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / hema
Select sal from emp a where 2=(select count(distinct sal)
from emp b where a.sal <= b.sal)
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / esakkiraja
select a.* from(select dense_rank() over(order by sal)as
new_rank from emp) a where new_rank=2
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / swapna
select top(2) sal from emp where sal order by desc
| Is This Answer Correct ? | 0 Yes | 4 No |
Answer / swapna
select top(1) sal From sample
where sal
in (select top(2) salfrom sample order by saldesc)
order by sal asc
| Is This Answer Correct ? | 0 Yes | 7 No |
What are the set operators union, union all, minus & intersect meant to do?
How do you increase the OS limitation for open files (LINUX and/or Solaris)?
How to drop an existing view in oracle?
HOW TO DISPLAY MAXIMUM SALARIES FROM EMP DEPARTMENT VISE ALONG WITH DEPARTMENT NAMES? E.g EMP,DEPT
5 Answers College School Exams Tests, DELL,
What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?
Which database is better for os platform dependency?
what is view?
What is sequence?
what is IDE,DMV in sql server?
Which dictionary tables and/or views would you look at to diagnose a locking issue?
Describe Referential Integrity ?
master table and child table performances and comparisons in Oracle ?