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

Answer Posted / suman rana

select * from emp e where 2 = ( select count(distinct sal)
from emp e1 where e1.deptno = e.deptno and E.SAL <= E1.SAL)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to call a sub procedure?

562


What are privileges and grants?

570


What to do if dba lost the system password?

595


What are the execution control statements in oracle?

600


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

524






State the difference between a primary key and foreign key?

515


How to rename an existing table?

605


How to convert dates to characters in oracle?

577


What is ceil and floor in oracle?

571


What are the attributes of cursor?

587


What is a initialization parameter file in oracle?

584


Explain user account with reference to oracle.

528


What is the difference between postgresql and oracle?

503


A table t is there.If you perform insert ,update and delete then the trigger will fire.What is the minimum no of trigger required for a table.

4257


What are the numeric comparison operations?

631