How to find 1st, 2nd, 3rd highest using select select
statement not using rownum

Answers were Sorted based on User's Feedback



How to find 1st, 2nd, 3rd highest using select select statement not using rownum..

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

How to find 1st, 2nd, 3rd highest using select select statement not using rownum..

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

Post New Answer

More Oracle General Interview Questions

What are the types of partitions in oracle?

0 Answers  


I want a table like, no name address addr1 addr2 So i want columns like addr1,addr2 under address column. Can one please answer me. Advance Thanks.

2 Answers   IBM,


select to_char('10','10') from dual This gives me an error oRA-1481 INVALID NUMBER FORMAT MODEL why? pls help

6 Answers  


Difference between an implicit & an explicit cursor.?

2 Answers  


Explain database link?

0 Answers  






Can we create trigger on view in oracle?

1 Answers  


What are the different pseudo commands? Explain in general?

0 Answers  


Which is better Oracle or MS SQL? Why?

2 Answers   Bally Technologies,


How to do paging with oracle?

0 Answers  


What is a trigger and what are its types in oracle?

0 Answers  


what is the use of triggers in Java program? I mean where do we use triggers in Java programming?

0 Answers  


What are the different types of failures that occur in Oracle database?

0 Answers   HCL,


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)