How to find 1st, 2nd, 3rd highest using select select
statement not using rownum
Answers were Sorted based on User's Feedback
Answer / madhavi
SELECT sal
FROM (SELECT sal, RANK() OVER(ORDER BY sal DESC) AS rnk
FROM emp)
WHERE rnk IN (1,2,3);
Is This Answer Correct ? | 14 Yes | 3 No |
Answer / ajit
select distinct *
from (select e.*,dense_rank()over(order by sal desc) rn from emp e)
where rn in (1,2,3);
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / annada
SELECT e.lastname,e.salary FROM employees e
WHERE 1=(SELECT count(*) FROM employess s
WHERE s.salary>e.salary
Is This Answer Correct ? | 1 Yes | 2 No |
How oracle handles dead locks?
How will you write a query to get a 5th rank student from a table student_report?
Explain the use of control file?
What are Clusters ?
How to export your connection information to a file?
What is difference between SUBSTR and INSTR?
How to convert csv to table in oracle?
How to increment dates by 1 in oracle?
What do you mean by merge in oracle and how can you merge two tables?
Describe an oracle table?
sql command 2 know current database
What is recycle bin in Oracle?