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
How to get execution statistics reports on query statements?
Can the query output be sorted by multiple columns in oracle?
How different is ms access and oracle?
What are joins, explain all types of joins?
How to upsert (update or insert into a table)?
Is oracle a relational database?
Explain compound trigger in oracle?
You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
What is meant by an index?
What are dml statements in oracle?
How to put more than 1000 values into an oracle in clause?
Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?
How do I use unicode codesets with the weblogic jdriver for oracle driver?
How translate command is different from replace?
What happens to indexes if you drop a table?