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
I creat Credit memo in AR. Now i want revers the Credit Memo.how you can revers that what out any aditional entry.
How to use "out" parameter properly?
What is the effect of setting the value "all_rows" for optimizer_goal parameter of the alter session command? What are the factors that affect optimizer in choosing an optimization approach?
What do you mean by a database transaction & what all tcl statements are available in oracle?
What is Data Dictionary Cache in Oracle?
Why use resource manager in Oracle?
What are group functions in oracle?
Can we call procedure inside function in oracle?
What exactly do quotation marks around the table name do?
What are the different types of synonyms?
What is an oracle and why it is used?
I have a database backup file in .db (ext) form how to conver it into .dmp (ext.) for oracle database
Can you have more than one content canvas view attached with a window ?
What is the difference between substr and instr?
How do we get field detail of a table?