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

Can sql function call stored procedure?

988


Is progress software supports to ( pl/sql )?

1021


What is the size of partition table?

1027


What is an exception in pl/sql?

1052


Lookups are a key component in sql server integration services (ssis). Explain its purpose?

983


How to find 3rd highest salary of an employee from the employee table in sql?

1060


Can I call a procedure inside a function?

985


Can we use ddl statements in stored procedure?

1129


What are the different sql languages?

1022


what are the authentication modes in sql server? How can it be changed? : Sql dba

1391


How do you modify a column in sql?

975


How to select unique records from a table?

1037


Is it important to partition hard disk?

1004


What are the constraints available in sql?

1027


what is the difference between union and union all? : Sql dba

1001