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 is a Synonym ?

3 Answers  


What is Data Block ?

2 Answers  


What is transport network substrate (tns) in oracle?

0 Answers  


How to calculate date and time differences in oracle?

0 Answers  


What is an Index ?

2 Answers  






Define 'view' advantage ?

2 Answers   AZTEC, TCS,


What is the difference between Sleep and Wait? (Java)

1 Answers   RBS,


How can you use check constraints for self referential integrity?

0 Answers  


What is the usage of control file in oracle?

0 Answers  


What is meant by joins? List out the types of joins.

0 Answers  


What is the difference between postgresql and oracle?

0 Answers  


What is catalog in Oracle?

0 Answers   MCN Solutions,


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)