Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to find only %th Highest Sal

Answers were Sorted based on User's Feedback



How to find only %th Highest Sal..

Answer / sujit pingale

Ans: select distinct(a.salary) from customers a where &n =
(select count(distinct(b.salary)) from customers b where
a.salary <= b.salary);

It will ask you to enter number in input box which salary
you want to see

Is This Answer Correct ?    3 Yes 0 No

How to find only %th Highest Sal..

Answer / sujitpingale

Ans: select distinct(a.salary) from customers a where &n =
(select count(distinct(b.salary)) from customers b where
a.salary <= b.salary);

Enter value in inputbox. If you enter 1 then it will give
highest salary

Is This Answer Correct ?    2 Yes 0 No

How to find only %th Highest Sal..

Answer / ajit

select e.*, rn
from ( select empno, ename, sal, deptno, dense_rank() over ( order by sal desc ) rn
from emp) e
where rn = & rn;

Is This Answer Correct ?    2 Yes 0 No

How to find only %th Highest Sal..

Answer / abhishekjaiswal

SELECT A.FIRST_NAME,
       A.SALARY
   FROM EMPLOYEES A
   WHERE 3 = ( SELECT COUNT(*) -- Replace 3 with any value of (N - 1)
               FROM EMPLOYEES B
               WHERE B.SALARY > A.SALARY)

Is This Answer Correct ?    1 Yes 0 No

How to find only %th Highest Sal..

Answer / pavan

select e.* from emp e where &n=(select count(distinct e1.sal)from emp e1 where e.sal>e1.sal)

Is This Answer Correct ?    0 Yes 0 No

How to find only %th Highest Sal..

Answer / ajit

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

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

How is a process of pl/sql compiled?

0 Answers  


How to add Foreign key in a table after the creation of the table?

5 Answers   Satyam,


How to use boolean type in select statement?

0 Answers  


How do you explain an index?

0 Answers  


What are the different dcl commands in sql?

0 Answers  


What is compute?

0 Answers  


how tsql statements can be written and submitted to the database engine? : Transact sql

0 Answers  


What are the different schemas objects that can be created using pl/sql?

0 Answers  


What is the difference between between and in condition operators?

0 Answers  


What is not null in sql?

0 Answers  


What is delimiter in pl sql?

0 Answers  


What is the maximum database size for sql express?

0 Answers  


Categories