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...

Query for second maximum salary in each in each department

Answer Posted / ram

SELECT empno,salary,dept_id FROM (SELECT empno,salary,dept_id,DENSE_RANK() OVER (PARTITION BY Dept_id ORDER BY Salary DESC)
as Rnk FROM emp) WHERE Rnk = 2;

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a foreign key have a different name?

998


How can a pl sql block be executed?

1004


When do we use triggers?

1149


what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql

1008


What is trigger with example?

1170


How exception handling is done in advance pl/sql?

1024


What is the purpose of cursors in pl/sql?

1204


How does postgresql compare to mysql?

1080


What is a recursive join sql?

1118


What is graph sql?

1039


Can we alter stored procedure?

1044


How do you modify a column in sql?

1054


Write a sql query to convert all character to uppercase after hypen.

1486


What is an invalid partition table?

1067


Is primary key clustered or nonclustered?

1063