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

select * from emp e1 where 2 =(select count(distinct(sal)) from emp e2 where e1.dno=e2.dno and e1.sal<=e2.sal);

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you have more than one key in a database?

992


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2067


What are the different types of triggers?

1191


Explain the difference between rename and alias?

1068


what is the command used to fetch first 5 characters of the string? : Sql dba

1684


How do I save a stored procedure?

1069


Are stored procedures faster than queries?

990


How to add a column ‘salary’ to a table employee_details?

1052


What is the difference between row level and statement level trigger?

1072


Whis is not false in primary key?

1522


What is the file extension for sql database?

1063


If the application is running very slow? At what points you need to go about the database in order to improve the performance?

1053


Is coalesce faster than isnull?

1017


How do I remove all records from a table?

1116


What is an escape character in sql?

1072