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 / shyam

select * from
(select ename,job,sal,deptno,
dense_rank()
over(partition by deptno order by sal desc) densrank
from emp)
where densrank<=2;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the most important ddl statements in sql?

1087


how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba

934


What is the sql case statement?

979


What is before trigger?

988


What are the types of functions in sql?

997


what is datawarehouse? : Sql dba

999


what is the use of double ampersand (&&) in sql queries?

1156


What are some emotional triggers?

964


what is the functionality of the function htmlentities? : Sql dba

929


What is sql procedures and functions?

991


What are the different types of dbms?

995


what happens if you no create privilege in a database? : Sql dba

981


Is nosql relational?

926


What is pl sql block in dbms?

990


What are the different schemas objects that can be created using pl/sql?

1004