how to find out second largest value in the table
Answers were Sorted based on User's Feedback
Answer / irshad ahmad
Select max(price) from product where price
not in (select max(price) from product);
Is This Answer Correct ? | 15 Yes | 3 No |
Answer / sandeep
select * from (select ename,sal,rank() over(order by sal desc) as ranks from emp)
where ranks=2;
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / karthik
select distinct sal from emp a where 2 = (select count
(distinct sal) from emp b where a.sal <= b.sal)
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / mk
select *from emp where sal=(select distinct(max(sal)) from
emp where sal <select max(sal) from emp )
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sudhakara reddy k
select max(sal) from emp where
sal<(select max(sal) from emp);
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / kamala k n
select * from (select ename,sal,rank() over(order by sal desc) as ranks from emp)
where ranks=2;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vishal
select * from (
select * from test where sal < (select max(sal) from test)
order by 2 desc)
where rownum =1
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / anandh
select * from emp where sal = (select max(sal) from emp where sal<>(select max(sal) from emp));
Is This Answer Correct ? | 0 Yes | 1 No |
What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?
What is the string concatenation operator in oracle?
which is the best training centre for learning oracle?
What are the different types of partitions in oracle?
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
how to tune oracle sql queries pls tell me step by step. urgent pls
How to retrieve first and last records from a table?
Hi Can any one tell me what are the API's used in requisition import.
What do you know about normalization? Explain in detail?
what is difference between table and view? where to use views? thanks in advance!
What is a data dictionary and how can it be created?
Is it possible to center an object horizontally in a repeating frame that has a variable horizontal size ?