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...

Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / ashish jain

select Salary from
(
select salary,ROW_NUMBER() over (order by salary desc) as rownum from Emp group by salary) temp
where rownum=2

Note :It can be used to get any highest salary, just use where rownum=nth 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 is the use of sql trace?

960


What is benefit of creating memory optimized table?

980


How do I run a sql trace?

966


The select into statement is most often used to create backup copies of tables or for archiving records?

1072


What is dynamic query?

985


What is sql engine in oracle?

998


Differentiate between sga and pga.

1169


How do you optimize a stored procedure query?

1004


Explain the purpose of %type and %rowtype data types with the example?

1001


explain the options of myisamchk to improve the performance of a table. : Sql dba

1028


Is it possible to create startup or shutdown trigger for on-schema?

1040


What is user in sql?

1027


What is join view in sql?

949


What is sql comments?

1081


Which normal form is best?

953