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 for second maximum salary in each in each department

Answer Posted / manju

select deptno,Max(e1.sal) from emp e1
where e1.sal NOT IN(
select Max(e2.sal) from emp e2
group by e2.deptno
)
group by e1.deptno

Is This Answer Correct ?    13 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I pipe the output of one isql to another?

1056


What is t-sql? : Transact sql

1040


What is a left join?

1006


how do you control the max size of a heap table? : Sql dba

1022


What is a rank in sql?

1005


What is coalesce sql?

1052


what is a database lock ? : Sql dba

1225


is mysql query is case sensitive? : Sql dba

1162


how to use like conditions? : Sql dba

1164


What is clustered and nonclustered index in sql?

985


Which table is left in left join?

1060


How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000

2205


what is view? : Sql dba

1029


What does the sign mean in sql?

1047


What is benefit of creating memory optimized table?

1032