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...

how to get the second max val for every group in a table

Answer Posted / venkat

select * from (
select e.deptno,d.dname,e.sal,dense_rank() over (
partition by e.deptno
order by e.sal desc ) "RANK",
e.ename
from emp_test e,dept_test d
where e.deptno=d.deptno)
where rank=2

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?

4524


Using the relations and the rules set out in the notes under each relation, write table create statements for the relations EMPLOYEE, FIRE and DESPATCH. You should aim to provide each constraint with a formal name, for example table_column_pk.

1858


How to delete an existing row from a table in oracle?

1072


Can sub procedure/function be called recursively?

1006


What is a parameter file in oracle?

1138


How to execute the package in oracle?

1086


How to get last row id?

1001


What is connection pool in oracle?

992


Can we convert a date to char in oracle and if so, what would be the syntax?

1019


What is meant by joins? List out the types of joins.

1033


What is Segment Advisor in Oracle?

1108


Explain temporal data types in oracle

1098


Can we use oracle pl/sql block in core java? if so how? pls get back to me .....

2970


What is transaction control statement and how many types of transaction control statement in Oracle?

1163


How to work with data objects interactively?

991