how to findout the 100th maximum salary

Answers were Sorted based on User's Feedback



how to findout the 100th maximum salary..

Answer / suresh

select sal from emp e
where 100=(select count( distinct sal) from emp where
e.sal<=sal)

Is This Answer Correct ?    10 Yes 0 No

how to findout the 100th maximum salary..

Answer / g.sivanagaraju

SELECT DISTINCT(A.SAL)
FROM EMP A
WHERE &N=(SELECT COUNT(DISTINCT(B.SAL))
FROM EMP B
WHERE A.SAL<=B.SAL);

Is This Answer Correct ?    2 Yes 0 No

how to findout the 100th maximum salary..

Answer / sanjay kumar

Select * from
(select distinct salary, dense_rank()over (Order by salary desc) rk from emp)
Where rk=100;

Is This Answer Correct ?    2 Yes 0 No

how to findout the 100th maximum salary..

Answer / cuong nguyen

select min(salary) from (select top 100 distinct salary from
emp order by salary desc)

Is This Answer Correct ?    3 Yes 2 No

how to findout the 100th maximum salary..

Answer / srinu

Hi Jyothi,

The below q uery is suitable for Nth max salary....

SELECT a.sal
FROM emp a
WHERE &N=(SELECT COUNT(DISTINCT b.sal)
FROM emp b
WHERE a.sal<=b.sal);
In the above query u can substitute any value like 1,2,..100 etc instead of &n.

Is This Answer Correct ?    1 Yes 0 No

how to findout the 100th maximum salary..

Answer / aswini

select min(sal) from (select sal from emp order by sal desc) where rownum<=100

Is This Answer Correct ?    1 Yes 0 No

how to findout the 100th maximum salary..

Answer / john bershan

select sgp from (select sgp,dense_rank() over (order by
sgp desc) as rownumber from t_policy_general)
where rownumber = '100';

Is This Answer Correct ?    1 Yes 0 No

how to findout the 100th maximum salary..

Answer / murali

select level,max(sal) from emp where level=&levelno connect by prior sal>sal group by level;

Is This Answer Correct ?    6 Yes 6 No

how to findout the 100th maximum salary..

Answer / gani

SELECT sal FROM table_name
ORDER BY sal DESC
LIMIT(99,1);

Is This Answer Correct ?    1 Yes 1 No

how to findout the 100th maximum salary..

Answer / maroju naveen

select level,max(sal) from emp where level=&levelno
connect by prior sal>sal
group by level;
This is Nth max(sal) query.....

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

what is oracle sql,pl/sql with interfaces

2 Answers   TCS,


What is the use of <> sql?

0 Answers  


What is cost in sql execution plan?

0 Answers  


SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the "sales_detail" table contains ten records with different values in the flavor column (two "vanilla," three "chocolate," four "strawberry," and one NULL), how many rows are returned by the sample code above? 1. 0 rows 2. 1 row 3. 3 rows 4. 4 rows 5. 10 rows

8 Answers   Sonata,


explain normalization concept? : Sql dba

0 Answers  






What is a design view?

0 Answers  


What is the use of cursor ? how cursor allocate context area for executing the sql statement?

4 Answers   HCL,


how to create object in plsql

3 Answers   Microsoft,


Explain normalization and what are the advantages of it?

0 Answers  


How to Declare Fixed Length String Value In PL SQL

0 Answers  


Is clustered index a primary key?

0 Answers  


How to get help at the sql prompt?

0 Answers  


Categories