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

How to schedule ssas database backup

0 Answers  


What is difference between sql and rdbms?

0 Answers  


What is snow flake schema design in database? What's the difference between star and snow flake schema?

0 Answers  


What is big data in database?

0 Answers  


what do u mean by implementation?

0 Answers  






How many types of relationship exist in database designing?

0 Answers  


What are procedures in dbms?

0 Answers  


What is database management definition?

0 Answers  


How many number of columns can a RECORD GROUP have ?

0 Answers  


Are Constraints exported through Export command?

1 Answers  


Can the SNAPSHOTS be refreshed automatically ?

1 Answers  


Describe and contrast sql and qbe.

0 Answers  


Categories