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

what is the difference between a web-garden and a web-farm? : Sql dba

1041


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

894


I need a function for a train ticket reservation please answer it thanks in advance

982


How do you explain an index number?

1056


How do I find duplicates in the same column?

1024


GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?

3024


What are the different ways to optimize a sql query?

910


Why are indexes and views important to an organization?

919


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

928


What is an example of translating a date into julian format?

1066


Explain the uses of a database trigger?

1005


what is the difference between nested subquery and correlated subquery?

1008


Can we perform dml on view?

996


What are the built in functions of sql?

1001


How do I quit sql?

915