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
How to join two tables in a single query using oracle?
How to convert numbers to characters in oracle?
What is an oracle table?
Can a formula column referred to columns in higher group ?
Hi Masters, in Oracle Applications 11i, we hace 2 functions using the same form, i need to create 1 personalization, but that code must afect only one function.... how can i do that?
 How to use an oracle sequence generator in a mapping?
What is background process in Oracle?
What is oracle database client?
Explain an index segment?
Does oracle charge for java?
What are the attributes of cursor?
What are the four Oracle system processes that must always be up and running for the database to be useable?
Is java required for oracle client?
What are the set operators union, union all, minus & intersect meant to do?
What is memory advisor in Oracle?