Query to get max and second max in oracle in one query ?
Answer Posted / satish
SELECT SAL FROM (SELECT SAL,DENSE_RANK() OVER(ORDER BY SAL DESC) RANK FROM EMP) WHERE RANK=2;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is it possible to insert comments into sql statements return in the data model editor ?
How to get last row id?
Can the query output be sorted by multiple columns in oracle?
How to create a table in a specific tablespace?
How to convert times to characters in oracle?
22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100
What is the disadvantage of User defind function?
Explain drop constraint oracle?
What is Virtual Private Database in Oracle?
Explain the different normalization forms?
What is columnar storage what is the advantage?
How to retrieve values from data fields in record variables?
What is transaction control statement and how many types of transaction control statement in Oracle?
What is hash cluster in oracle?
How to select some rows from a table in oracle?