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

SELECT empno,salary,dept_id FROM (SELECT empno,salary,dept_id,DENSE_RANK() OVER (PARTITION BY Dept_id ORDER BY Salary DESC)
as Rnk FROM emp) WHERE Rnk = 2;

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are sql injection vulnerabilities?

912


what is csv? : Sql dba

946


What is the purpose of my sql?

903


Why do we go for stored procedures?

995


Write an sql query to select all records from the table?

970


What is the difference between function and procedure in pl/sql?

1017


How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?

1384


What is oracle pl sql developer?

936


What are crud methods?

971


Are stored procedures compiled?

873


Are sql database names case sensitive?

937


What is cross join sql?

868


define sql insert statement ? : Sql dba

977


what is row? : Sql dba

1169


How do I turn a list into a table?

910