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

Can we commit in trigger?

1029


How insert into statements in sql?

1123


Why do we need databases?

1093


What is the use of <> sql?

1039


How do I audit the sql sent to the server?

1059


What is the difference between alter trigger and drop trigger statements?

1164


how to get a list of all tables in a database? : Sql dba

1030


What are the different types of tables in sql?

1068


What are literals in sql server?

1259


When is a declare statement required?

1197


How do you exit in sql?

1159


Can we create clustered index without primary key?

1002


What is rowtype?

1081


How you can copy a file to file content and file to pl/sql table in advance pl/sql?

1186


What does select count (*) mean in sql?

1075