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 / ramya p

select deptno, max(sal) from (select * from emp order by
sal desc)
where rownum < 3
group by deptno
order by max(sal) desc;

Is This Answer Correct ?    5 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are functions in sql?

936


Why do we create views in sql?

1130


Is vs as in pl sql?

968


Is pl sql a scripting language?

1013


What is the usage of when clause in trigger?

1032


What are sql functions? Describe the different types of sql functions?

1122


What are the types of operators available in sql?

1050


What is the difference between microsoft access and sql server?

1033


What is sql query optimization?

1090


What are the uses of sysdate and user keywords?

1086


Is join an inner join?

948


What are sql triggers used for?

980


What is the difference between view and stored procedure?

950


Can we enter data in a table in design view?

952


What do you mean by field in sql?

1069