How to find only %th Highest Sal
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
i have a table with column sno with 30 records. i want to update this column by item by item in asp.net. i wantto enter new values into that from 1 to 30 how is it possible with backend c#
what is the difference between ereg_replace() and eregi_replace()? : Sql dba
What are data types in pl sql?
how to create a table index in mysql? : Sql dba
What are actual parameters and formal parameters?
what are wild cards used in database for pattern matching ? : Sql dba
what are the different tables present in mysql? : Sql dba
What is the difference between having clause and where clause?
What is the most common sql injection tool?
i have a table t1 a math 20 b phy 30 cchemisty 10 a math 40 b phy 23 c che 21 a math15 bphy 33 c che 56 write a quire to find out the max markr of each subject
Is it mandatory for the primary key to be given a value when a new record is inserted?
Is natural join same as inner join?