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

Answer Posted / samir kumar sahoo

SELECT sal FROM(SELECT DISTINCT(sal) FROM employees ORDER
BY sal DESC) WHERE ROWNUM<=2;

Is This Answer Correct ?    23 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain an extent?

657


How do you tell what your machine name is and what is its IP address?

1513


Explain the use of record option in exp command.

533


How can I see all tables in oracle?

538


How does oracle handle read consistency?

674






What is an oracle?

575


How to display row numbers with the records?

584


normally database take to refresh time 2 hours. but client asked iwant to refresh with in 5 min that same database. do you have any option in BO and Oracle? explain me briefly...kavi

1736


How to increment dates by 1 in oracle?

557


Assuming that you are an End User How to find that in the payment Batch some of the Invoice was  Missing To pay How to find That??

1268


Explain the use of consistent option in exp command.

546


What is oracle in java?

524


What is a proxy object?

579


Explain the difference between sap and oracle?

573


Where do we use decode and case statements?

557