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

Write a query to find the names of users that begin with "um" in sql?

927


explain the difference between bool, tinyint and bit. : Sql dba

939


How do I remove duplicates in two columns?

977


How do I run a pl sql program?

1066


Which sql statement is used to return only different values?

954


What does a pl/sql package consist of?

931


what is dbms? : Sql dba

934


Write a sql query to find the names of employees that begin with ‘a’?

954


How many sql statements are used?

965


Is sql scripting language?

975


What is sqlservr exe?

943


Define concurrency control. : Transact sql

1106


What are basic techniques of indexing?

1325


how to convert character strings to numeric values? : Sql dba

1026


What is rownum?

924