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
Difference between cartesian join and cross join?
hi friends i completed b.com 2004.i have 3y accounting exp. in manufacturing company.now i have completed oracle finance.pls suggest me how will get job in oracle.can i get job in oracle.
How to list all user accounts in oracle?
Explain drop constraint oracle?
What is merge in oracle?
Explain compound trigger in oracle?
Can you assign multiple query result rows to a variable?
What are the different pseudo commands? Explain in general?
How to find the duplicate rows count from employees table in oracle?
How to use an explicit cursor without open statements?
WHAT IS ecc 6.0
How does propagation differ between Advanced Replication and Snapshot Replication (read-only)?
What would you do with an in-doubt distributed transaction?
How to convert characters to numbers in oracle?
What is the difference between online and offline backups?