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

Where is all the data on the internet stored?

1025


What is an oracle stored procedure?

1067


What is difference between joins and union?

1136


how to create a new table by selecting rows from another table in mysql? : Sql dba

1117


Define sql delete statement.

1016


What are the operators in sql?

1036


Is nosql faster than sql?

1033


Is sql a dbms?

1022


Can ddl statements be used in pl/sql?

1152


Why are cursors used?

1124


What is difference between sql and oracle?

1140


What do you mean by field in sql?

1089


What is the requirement of self-join?

1136


Do ddl statements need commit?

978


Write an sql query to select all records from the table?

1040