Query to get max and second max in oracle in one query ?
Answer Posted / rohit
The below query will provide the max and second max in
oracle in one query
select * from emp e
where 0 = (select count(sal) from emp
where e.sal < sal)
or 1 = (select count(sal) from emp
where e.sal < sal);
| Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
What is tns service name?
What is oracle update statement with inner join ?
why should i declare foreign key constraint as self relation instead of binary relation in tables ?
what is the difference between functional dependecy and multilevel dependency?
Explain the use of grant option in imp command.
What are the different types of trigger and explain its various uses and functions?
Please explain oracle left join with an example?
How to define a procedure inside another procedure?
How will you differentiate between varchar & varchar2?
What is an external table?
How to use in conditions in oracle?
How to use null as conditions in oracle?
What are the differences between char and nchar in oracle?
What is pragma autonomous transaction in oracle?
Explain about integrity constraint?