Query to get max and second max in oracle in one query ?

Answer Posted / mehul

select max(sal) from emp where sal not in ( select max(sal)
from emp)

Is This Answer Correct ?    29 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we protect our pl/sql source code?

572


i have a question here... As of my knowledge, when we apply an index (b-tree)on a column, internally it arranges the data in b-tree format and do the fetching process correspondingly... and my quetion is... How a bit-map index arranges the data internally when applied on a column?IS it in b-tree format or whatelse?

1470


How to name query output columns in oracle?

682


hey friends, What are the steps I can do to transfer the database from Microsoft Access 2003 to oracle10g (or SQL) Best regards

1562


How remove data files before opening a database?

560






How do you store pictures in a database?

555


How to create a new user account in oracle?

576


What are the attributes of cursor?

587


Explain index?

743


What is a user account in oracle?

625


Explain about functional dependency and its relation with table design?

550


How to bring a tablespace online?

518


What are the general rules on data consistency?

587


What is connection pooling in oracle?

552


What are the attributes of the cursor?

553