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 write a query with a left outer join in oracle?
Can we convert a date to char in oracle and if so, what would be the syntax?
How to list all tables in your schema?
How do you bind variables in oracle?
Does facebook use oracle?
What query tells you how much space a tablespace named test is taking up, and how much space is remaining?
How to calculate date and time differences in oracle?
What is save point in oracle database?
what is meant by magic query
How many types of segments in Oracle?
How many categories of data types?
What are the different types of failures that occur in Oracle database?
How to start a new transaction in oracle?
How to select some columns from a table in oracle?
Explain what are synonyms used for?