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

select department_id, salary from
(select department_id, salary, rank() over(partition by
department_id order by salary desc) r from employees) where r=2;



cheers;

Is This Answer Correct ?    35 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is user defined functions? : Sql dba

1027


what is primary key? : Sql dba

1023


how many ways we can we find the current date using mysql? : Sql dba

1098


Why we use triggers in mysql?

990


What is sqlca in powerbuilder?

1002


What is a field in a database?

1063


What are the different types of functions in sql?

1048


What is difference between sql and oracle?

1119


What is on delete set null?

1085


How subquery works in sql?

1067


What are the different types of joins in sql?

1778


What is the difference between join and natural join?

927


Can %notfound return null after a fetch?

1054


Can there be more than one function with a similar name in a pl/sql block?

979


What are commit, rollback, and savepoint?

986