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 cursor?where are they used?
Explain the difference between replace() and translate() functions in oracle?
What is different bet native dynamic sql and Dbms_Sql?
Explain an index?
How to convert a string to a date in oracle database?
What is an oracle tablespace?
What do you understand by a database object? Can you list a few of them?
how can we store any pdf file in oracle
How can I convert single byte kana characters into multi byte kana characters and vice-versa.
How to load a large xml file?
What are the uses of synonyms?
How to insert a record into a table?