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 |
In which language oracle has been developed?
I have a parent program and a child program. I want to write a statement in Exception Block of the parent program so that when the statement in the exception block is executed, the control goes to the next statement in the parent block bypassing the child block.How do i do that?
What is the difference between translate and replace in oracle?
How to define an oracle sub procedure?
What are the components of Logical database structure of ORACLE database?
How to connect to a local oracle 10g xe server?
Display the number value in Words?
1. Display the post code and the purchase order number for each purchase order. Sort the output set by postcode.
What are various constraints used in SQL?
Can we protect our pl/sql source code?
what is a Nested Loop join?
What is the usage of save points in oracle database?