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 |
What is sql mysql pl sql oracle?
Can you skip header records while loading? : aql loader
Is microsoft sql free?
what is datawarehouse? : Sql dba
is it necessary to write group by and order by clause together
Is it possible to update views?
What is your daily office routine?
How to access the current value and next value from a sequence?
Can we call stored procedure in function?
What is character functions?
Can we join more than 2 tables in sql?
Types of joins ?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)