Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the built-in functions used for sending Parameters to forms ?

3390


Is insert autocommit in oracle?

1075


How to use values from other tables in update statements using oracle?

1085


how to do daily transactions with out sql* loader control file regesterd in apps?

1688


What is the data pump import utility?

1040


How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

1916


material view and view disadvantages?

1079


What privilege is needed for a user to create indexes in oracle?

1028


WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?

2210


Explain oracle’s server parameter file.

999


What is an oracle tablespace?

1049


How to define an explicit cursor in oracle?

1046


What is a subquery in oracle?

1114


What is an oracle?

1022


you are a universe designer and report developer in BO, what type of information you gather from client?Briefly explain plz

1945