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 stored procedures?

7 Answers   TCS, Wells Fargo,


if i have a procedure with 1000 line.when i run this in 61 line i got the error but i want to continue the programe without error.can anyone tell me how to handle that error.

1 Answers   MasterCard,


What is E-R diagram ?

2 Answers   CGI, Keane India Ltd,


What are the various oracle database objects?

0 Answers  


What are temporal data types in oracle?

0 Answers  






What is a Temporary Segment ?

2 Answers  


How many memory layers are in the oracle shared pool?

0 Answers  


What is the sql query to concatenate column values from multiple rows in oracle?

0 Answers  


How to restrict the duplicate records in table valuesets

2 Answers   IBM,


How to define an external table with a text file?

0 Answers  


Explain the use of consistent option in exp command.

0 Answers  


Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.

0 Answers  


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)