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
How to rename an index in oracle?
What is the difference between online and offline backups?
How to export several tables together?
What is a table in oracle?
How to convert character types to numeric types?
Explain the use of control file?
What is meant by a deadlock situation?
What is rowid and rownum in oracle?
What are the different types of record groups in oracle? Explain each of them
How to bring a tablespace online?
what are the advantages of running a database in archive log mode?
Explain the features of oracle?
Will you be able to store pictures in the database?
Give the different types of rollback segments.
How to set a transaction to be read only in oracle?