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

Why truncate is used in sql?

938


Why we use pl sql?

908


How do you run a query?

958


What is the use of prepared statement?

953


how are mysql timestamps seen to a user? : Sql dba

1051


how to use case expression? : Sql dba

960


Is hadoop a nosql?

950


Why do we need cursors in pl sql?

1005


What is cost in sql execution plan?

909


What is the difference between having and a where in sql?

1034


What are the types of functions in sql?

968


How do you know if a relationship is 2nf?

878


How do I restart sql?

915


What is information schema in sql?

1017


what is primary key? : Sql dba

956