Query to get max and second max in oracle in one query ?
Answer Posted / rohit
The below query will provide the max and second max in
oracle in one query
select * from emp e
where 0 = (select count(sal) from emp
where e.sal < sal)
or 1 = (select count(sal) from emp
where e.sal < sal);
| Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
Whats the benefit of dbms_stats over analyze?
How to work with data objects interactively?
Can we save images in a database and if yes, how?
How many types of tables supported by oracle?
What is oracle latest version?
What is oracle database client?
if you ctreate table identity
What is Segment Advisor in Oracle?
How many types of table in Oracle?
Explain a segment?
What is an oracle recycle bin?
Can we commit inside a function in oracle?
Can we create trigger on materialized view in oracle?
What is the minimum client footprint required to connect c# to an oracle database?
 How to use an oracle sequence generator in a mapping?