how to find out second largest value in the table

Answers were Sorted based on User's Feedback



how to find out second largest value in the table..

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

how to find out second largest value in the table..

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

how to find out second largest value in the table..

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

how to find out second largest value in the table..

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

how to find out second largest value in the table..

Answer / sudhakara reddy k

select max(sal) from emp where
sal<(select max(sal) from emp);

Is This Answer Correct ?    1 Yes 0 No

how to find out second largest value in the table..

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

how to find out second largest value in the table..

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

how to find out second largest value in the table..

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

Post New Answer

More Oracle General Interview Questions

How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.

1 Answers  


various types of joins

9 Answers  


how to see the data (in unix) using dataset in datastage?

1 Answers   iGate,


Why oracle is used?

0 Answers  


what is reindexing?

0 Answers   Tata Technologies,






Define the terms primary key foreign key and also the difference between primary and the unique key

2 Answers  


Find all employees in Dept “Marketing”.

2 Answers  


For a field in a repeating frame, can the source come from the column which does not exist in the data group which forms the base for the frame ?

0 Answers   Oracle,


How can I combine multiple rows into a comma-delimited list in oracle?

0 Answers  


How to divide query output into groups in oracle?

0 Answers  


How to create a new table in your schema?

0 Answers  


Can you have more than one content canvas view attached with a window ?

0 Answers   Oracle,


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)