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

select * from emp x where 2=(select count(distinct sal) from
emp y where x.sal<=y.sal) group by deptno;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Difference Between Unique and Primary Key Constraints?

1151


What is the command used to fetch the first 5 characters of a string?

1255


How do I view stored procedures?

1020


what are aggregate and scalar functions? : Sql dba

1104


What is nvarchar in sql?

976


What is identity column in sql server?

1100


What is the difference between nested table and varray?

1047


What is cursor and why it is required?

1251


What is trigger in sql and its types?

1107


What is a recursive stored procedure?

1247


Can we use having without group by in sql?

1043


What is the difference between a primary key and a unique key?

1102


What is mdb stand for?

1056


How do you optimize a stored procedure query?

1040


What are the disadvantages of not performing database normalization?

1213