Query to get max and second max in oracle in one query ?
Answer Posted / ajit
select max(sal),1 no
from emp
union
select sal,rn from (select sal,rownum rn from emp)
where rn = 2
order by 1 desc;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Difference between pre-select and pre-query
What is parameterized cursor in oracle?
How to write date and time literals in oracle?
How to find out what oracle odbc drivers are installed?
Explain the use of inctype option in exp command.
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.
How oracle handles dead locks?
What is oracle thin client?
How to call a sub procedure?
What is meant by a deadlock situation?
Explain the use of indexes option in exp command.
Explain the difference between replace() and translate() functions in oracle?
you are a universe designer and report developer in BO, what type of information you gather from client?Briefly explain plz
What is an anonymous block?
State some uses of redo log files?