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

select * from(select row_number() over(partition by deptno order by sal desc) rn,a.* from emp a) where rn=1;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there a way to automate sql execution from the command-line, batch job or shell script?

968


How do you use a while loop in pl sql?

1006


why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba

1103


Is inner join faster than left join?

1185


What is $$ in sql?

984


Can you selectively load only those records that you need? : aql loader

1044


What is cursor explain with example?

979


How do you update a value in sql?

1036


Is there a 64 bit version of ssms?

956


What are the different parts of a package?

1108


What is materialized view in sql?

916


how can we destroy the session, how can we unset the variable of a session? : Sql dba

995


who introduced sql?

1009


How many indexes can be created on a table in sql?

1047


how to use 'mysql' to run sql statements? : Sql dba

1051