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

Answer Posted / naveen

select sal from employee where sal >= (select max(sal) from
employee where sal not in (select max(sal) from employee))

Is This Answer Correct ?    7 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can the query output be sorted by multiple columns in oracle?

574


What happens to the indexes if a table is recovered?

579


How to get execution statistics reports on query statements?

572


How to create id with auto_increment on oracle?

547


Please explain oracle left join with an example?

587






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?

1472


How to write a query with an inner join in oracle?

564


What is oracle analytical function?

529


What is an oracle database?

612


How do I uninstall oracle 11g?

563


What is merge in oracle?

561


How to view the data files in the current database?

594


What are triggers in oracle?

561


Explain what are synonyms used for?

610


What is the usage of save points in oracle database?

533