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 are triggers in oracle?
Explain self joins in oracle?
How to add a new column to an existing table with a default value?
What is the database name in oracle?
What is the effect of setting the value "ALL_ROWS" for OPTIMIZER_GOAL parameter of the ALTER SESSION command ?
Can you tell me how to add new column in existing views?how?How is possible?
what is the uses of cusor
What is a dead lock in oracle?
How to create id with auto_increment on oracle?
What is clustered table in Oracle?
Explain joins in oracle?
How many categories of data types in oracle?