Query to get max and second max in oracle in one query ?
Answer Posted / sunil
select sal from (select dense_rank() over(order by sal) rank
from emp) where rank in(1,2);
In above query you will get both highest and second highest
salary details even there are more people who are getting
highest and second highest salary.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the built-in functions used for sending Parameters to forms ?
Is insert autocommit in oracle?
How to use values from other tables in update statements using oracle?
how to do daily transactions with out sql* loader control file regesterd in apps?
What is the data pump import utility?
How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?
material view and view disadvantages?
What privilege is needed for a user to create indexes in oracle?
WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?
Explain oracle’s server parameter file.
What is an oracle tablespace?
How to define an explicit cursor in oracle?
What is a subquery in oracle?
What is an oracle?
you are a universe designer and report developer in BO, what type of information you gather from client?Briefly explain plz