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 |
I know that i can create a table without a primary key.But is there any significance for that table???? while creating an application.
What is mean by Program Global Area (PGA) ?
Differentiate between translate and replace?
how to insert the image in table
How to create an oracle database?
What is a Shared SQL pool ?
what is the difference between dbms and rdbms?
what are the things that you consider while creating indexes on partitioning tables?
I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.
How do we switch from init.ora file to asp file?
How to set a transaction to be read only in oracle?
What is PL/SQL ?