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 / manish gupta

select deptno,sal from (select * from emp order by sal
desc) where rownum<3
union
select deptno,sal from (select * from emp order by sal
desc) where rownum<3 and deptno not in(20);


considering scott table in db.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is primary and foreign key?

1049


explain advantages of myisam over innodb? : Sql dba

1055


Explain foreign key in sql?

1009


What is serial sql?

960


how can we know the number of days between two given dates using mysql? : Sql dba

1031


What are three advantages to using sql?

993


How many sectors are in a partition?

1064


What is an invalid partition table?

1013


What is pessimistic concurrency control? : Transact sql

1072


Is clustered index a primary key?

935


what is the difference between delete and truncate statement in sql? : Sql dba

1216


What is pl sql and why it is used for?

1100


What is %type in pl sql?

955


what is difference between delete and truncate commands? : Sql dba

1109


How do you optimize a query?

980