find out the second highest salary?
Answer Posted / abhijit ramakant parb
select min(a.sal) from(select distinct d.sal from emp d
order by sal desc) a where rownum<=2;
To retrieve all columns
select * from emp where sal=(select min(a.sal) from(select
distinct d.sal from emp d order by sal desc) a where
rownum<=2);
| Is This Answer Correct ? | 12 Yes | 6 No |
Post New Answer View All Answers
Whats the benefit of dbms_stats over analyze?
What is oracle server autotrace in oracle?
What is Library Cache in Oracle?
when we are importing items in inventory, showing errors, Oracle support suggested us for running scripts & also suggested if we run scripts, iprocurement applicaation if is there it will show shared and if we go in future for iprocurement, it wont work. So kinldy suggest any functional solution.
What is a data dictionary and how can it be created?
What is the difference between truncate & delete command?
What is the simplest tool to run commands on oracle servers?
Can select statements be used on views in oracle?
Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).
What are temporal data types in oracle?
Give the different types of rollback segments.
How to pass parameters to procedures in oracle?
Difference between oracle's plus (+) notation and ansi join notation?
How do we create privileges in oracle?
What are the arithmetic operations?