Query to get max and second max in oracle in one query ?
Answer Posted / amit golia
SELECT min(sal) FROM(SELECT DISTINCT(sal) FROM emp ORDER
BY sal DESC) WHERE ROWNUM<=2;
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is oracle datasource?
When do you get a .pll extension in oracle?
What is a database table in oracle?
How to use "in" parameter properly?
What is a named program unit?
What is a cognitive schema?
Is there a combination of "like" and "in" in sql?
Oracle
Explain an index?
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
Explain a segment?
Explain the use of ignore option in imp command.
Why does oracle 9i treat an empty string as null?
How to create a stored procedure in oracle?
what is Single Byte Overhead...?