Query to get max and second max in oracle in one query ?
Answer Posted / roopa
SELECT MAX(E1.sal), MAX(E2.sal)
FROM emp E1, (SELECT sal FROM emp
WHERE sal NOT IN ( SELECT MAX(sal) FROM emp)) E2
| Is This Answer Correct ? | 7 Yes | 7 No |
Post New Answer View All Answers
Can we store pictures in the database and if so, how it can be done?
Explain the use of Merge statement in oracle 11g
What is backup in Oracle?
How to view the data files in the current database?
How to grant create session privilege to a user in oracle?
What is Library Cache in Oracle?
What is tns entry?
How do we represent comments in oracle?
What is merge statement used for?
What is varray?
How to compare dates in oracle sql?
what are actual and formal parameters?
What are the restrictions on external table columns?
What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?
How to create a table in a specific tablespace?