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

How many types of literals are available in pl sql?

1047


Can we create table in function?

907


What are the types of subqueries?

1018


What is the difference between stored procedure and view?

964


What is Difference Between Unique and Primary Key Constraints?

1060


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

1179


Why is nosql good?

978


What is the difference between nvl function, ifnull function, and isnull function?

1052


What is restrict in sql?

1035


Can we connect to postgresql using sql developer?

937


What do you understand by case manipulation functions?

954


What is sequence in sql?

945


What is sql and db2?

944


List and explain the different types of join clauses supported in ansi-standard sql?

1301


What is offset and limit in sql?

1002