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 shutdown your 10g xe server from command line?
What language does oracle use?
How to delete a column in an existing table?
What is null value in oracle?
What is a cursor variable?
What is meant by a deadlock situation?
how to clone 9i Database on to 10g Database.
Typically, where is the conventional directory structure chosen for Oracle binaries to reside?
How to rename an existing table?
How to define a data field as not null?
15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.
What is Java Pool in Oracle?
What happens to the current transaction if the session is ended?
What is a sub query? What are its various types?
What is a dead lock in oracle?