how to findout the 100th maximum salary

Answers were Sorted based on User's Feedback



how to findout the 100th maximum salary..

Answer / sajid siddiki

SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT
(DISTINCT (b.sal)) FROM EMP B WHERE a.sal < = b.sal);
For Eg:-
Enter value for n: 100
SAL
---------
3700

Is This Answer Correct ?    0 Yes 0 No

how to findout the 100th maximum salary..

Answer / g sivanagaraju

SELECT sal
FROM emp e
WHERE &100=(SELECT COUNT(DISTINCT(SAL))
FROM emp
WHERE e.sal<=sal);

Is This Answer Correct ?    0 Yes 0 No

how to findout the 100th maximum salary..

Answer / swastik

SELECT LEVEL, MAX(Sal)
FROM Emp
GROUP BY LEVEL
HAVING LEVEL = &GiveNo
CONNECT BY PRIOR Sal > Sal;

Is This Answer Correct ?    0 Yes 0 No

how to findout the 100th maximum salary..

Answer / ram

select * from emp
where sal in(select max(sal) from emp
where level=&nth
connect by prior sal>sal
group by level)order by sal

Is This Answer Correct ?    0 Yes 0 No

how to findout the 100th maximum salary..

Answer / siva prasad

SELECT B.* FROM
(SELECT A.*,DENSE_RANK() OVER(ORDER BY SAL DESC) V_SAL
FROM EMP A )B
WHERE V_SAL = 100

Is This Answer Correct ?    0 Yes 0 No

how to findout the 100th maximum salary..

Answer / parul verma

select min(salary) from (select distinct salary from emp
where salary is not null order by salary desc) where rownum
<=100;

Is This Answer Correct ?    0 Yes 1 No

how to findout the 100th maximum salary..

Answer / lince

select sal from
(
select row_number() over (order by sal desc) as rno,sal
from Emp
)T
where T.rno=100

Is This Answer Correct ?    0 Yes 2 No

how to findout the 100th maximum salary..

Answer / raghuvir

select min(sal) from empl where romwnum < = 100 order by
sal desc

Is This Answer Correct ?    1 Yes 4 No

how to findout the 100th maximum salary..

Answer / akki reddy

SELECT *
(SELECT SAL, ROWNUM RN FROM EMP ORDER BY SAL DESC)
WHERE RN=100;

Is This Answer Correct ?    0 Yes 3 No

how to findout the 100th maximum salary..

Answer / katasani rajesh reddy

select salary from(select salary from
order by salary)
where rownum<=100
minus
select salary from(select salary from
order by salary)
where rownum<=99

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

0 Answers  


What action do you have to perform before retrieving data from the next result set of a stored procedure ?

0 Answers   Microsoft,


can we update a view which is created from two tables

11 Answers  


What are the steps for performance tuning.

0 Answers  


What is a schema? How is it useful in sql servers?

0 Answers  






What can be a size of a pl/sql block? Is there any limit?

2 Answers  


How do you select unique values in sql?

0 Answers  


What is data control language (dcl)?

0 Answers  


What is the difference between numeric and autonumber?

0 Answers  


what is purge command explain about oracle performance tuning

2 Answers   Accenture, eCentric Solutions,


What is a left join?

0 Answers  


What is java sql connection?

0 Answers  


Categories