Query to get max and second max in oracle in one query ?
Answer Posted / shareef
select ename,empno,sal,r from(select ename,empno,sal,dense_rank() over(order by sal desc) r from emp) where r=3; ----by using dense_rank()
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to get a list of all background sessions in the database?
How to save query output to a local file?
How to find the duplicate rows count from employees table in oracle?
Can you create a synonym without having a table?
What is the use of oracle?
What is the quickest way to export a table to a flat file?
What are the differences between primary key and unique key?
What is a lookup table in oracle?
In AP we done Customizations for Late Payments Charges. For Reporting Purpose What are the Documents Prepared for Customer Understanding??
What are a collation and state the different types of collation sensitivity?
Explain the difference between sql and oracle?
1) WIll all the user get the DEFAULT profile, if their current profile got deleted at any point of time? 2) What are the Situation we need to MOVE the TABLE between T.spaces? 3) What is the use of MOVING the TABLE between SCHEMA'S? 4) What are the Table Clause, Segment Clause and the Datafile Clause which will override each other? 5) Explain SORT_AREA_SIZE of Tempfile to make UNIFORM SIZE
What is varray?
How can I combine multiple rows into a comma-delimited list in oracle?
What is a nested table and how is it different from a normal table?