how can find the second max sal for every group(i.e i want
group the data based on key and find the second max sal for
every group

Answer Posted / nathan

SELECT *
FROM (SELECT deptno, sal,
DENSE_RANK () OVER (PARTITION BY deptno ORDER
BY sal DESC)

ranks
FROM emp)
WHERE ranks = 2;

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define the SGA and: How you would configure SGA for a mid-sized OLTP environment? What is involved in tuning the SGA?

1860


can anyody please send me the dump for Oracle 10g certifications for DBA path?

1698


What is connection pooling in oracle?

552


Which environment variables are absolutely critical in order to run the OUI?

1661


What is oracle rownum?

522






What is oracle server autotrace in oracle?

617


How to create a new oracle data file?

561


What is Data Dictionary Cache in Oracle?

664


How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?

1475


Explain enable novalidate constraint.

599


What are the ways tablespaces can be managed and how do they differ?

1619


What happens if recursive calls get out of control?

551


What are the restrictions in a oracle read only transaction?

574


What is the effect of setting the value "all_rows" for optimizer_goal parameter of the alter session command? What are the factors that affect optimizer in choosing an optimization approach?

527


How would you begin to troubleshoot an ORA-3113 error?

1605