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 to produce numbers from 1 to 10 using dual table
i have procedure p1.and also i declare the same procedure in a package. whice one is efficient package procedure or procedure?
How to Identify the previously inserted/updated records in already populated table.
What are the restrictions on external table columns?
what is difference between where clause and having clause?
How to call a stored function in oracle?
How to convert character types to numeric types?
How to use subqueries in the from clause in oracle?
How do I limit the number of rows returned by an oracle query after ordering?
what are the disadvantages of hierarchial database over RDBMS?
Explain the use of ignore option in imp command.
Difference between varchar and varchar2 data types?