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

i need department wise top 2 employees salary.which logic
i will use

Answer Posted / neetika vardhan

SELECT dept, MAX(sal)
FROM EMP WHERE sal NOT IN (SELECT MAX(sal) FROM emp GROUP
BY dept)
GROUP BY dept

UNION

SELECT dept, MAX(sal)
FROM EMP
GROUP BY dept

Is This Answer Correct ?    17 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is faster union or join?

1025


Mention what are the benefits of pl/sql packages?

1156


What problem one might face while writing log information to a data-base table in pl/sql?

1250


What are % type and % rowtype?

1081


How do you determine the current isolation level? : Transact sql

1206


Mention what is the use of function "module procedure" in pl/sql?

1088


What is a pragma statement?

1335


Is a foreign key always unique?

983


What packages are available to pl/sql developers?

1111


how do you tune the slow running queries in oracle db , explain the methodology

3230


What is procedure in pl sql?

1090


What is right join in sql?

1157


Why do we use procedures in sql?

1141


Can we rollback truncate?

1050


define sql insert statement ? : Sql dba

1080