write a query to Find the Maximun second value in table?

Answers were Sorted based on User's Feedback



write a query to Find the Maximun second value in table?..

Answer / ruchi

you can use following query
select max(sal) from emp where sal<(select max(sal) from
emp);

Is This Answer Correct ?    3 Yes 1 No

write a query to Find the Maximun second value in table?..

Answer / tulasi

select * from emp x where 2=(select count(distinct sal)
from emp y where x.sal<=y.sal);

Is This Answer Correct ?    3 Yes 1 No

write a query to Find the Maximun second value in table?..

Answer / kd

select sal
from
(selec sal, row_number () over (order by sal desc nulls
last) as rnk
where rnk = 2;

Is This Answer Correct ?    0 Yes 0 No

write a query to Find the Maximun second value in table?..

Answer / smriti

select salary from(select rownum r,salary from details
order by salary desc)where rownum<2 and salary<(select max
(Salary) from details)

Is This Answer Correct ?    0 Yes 1 No

write a query to Find the Maximun second value in table?..

Answer / kavita

select max(sal) from emp where sal not in (select max(sal)
from emp)

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More Database Management Interview Questions

Explain the syntax of named procedure?

0 Answers  


Have you heard about sixth normal form?

0 Answers  


How the status of the Rollback segment can be viewed ?

1 Answers  


Enlist the advantages of normalizing database.

0 Answers  


What is rdms?

0 Answers  


How to Ensure Data Integrity in a Relational Database?

0 Answers  


Why is databases important in healthcare?

0 Answers  


What is database definition (dbd)?

0 Answers  


What is db flush?

0 Answers  


Is it possible to declare or create a cursor for update of table? If no tell me why?

0 Answers  


Why do we need database?

0 Answers  


Mention the differences between the clustered and non-clustered index

0 Answers  


Categories