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

How to raise user-defined exception with custom sqlerrm ?

1129


Which is better trigger or stored procedure?

950


What is serial sql?

974


Why stored procedure is better than query?

946


How to rename a table?

1017


How much does sql certification cost?

1088


what is union? : Sql dba

1025


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

968


What are the basic sql commands?

1090


What is the difference between cross join and natural join?

1020


What is the difference between the implicit and explicit cursors?

1048


What does <> sql mean?

1084


Describe different types of general function used in sql?

1036


Is sql harder than python?

1102


What are the different types of sql commands?

1126