Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 / 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

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

how to produce numbers from 1 to 10 using dual table

4 Answers   Genpact,


Is oracle a language?

0 Answers  


What is the use of aggregate functions in oracle?

0 Answers  


Difference between NO DATA FOUND and %NOTFOUND?

1 Answers  


How to call a sub procedure?

0 Answers  


What is a connect identifier?

0 Answers  


Explain database link?

0 Answers  


State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.

0 Answers   Atos Origin,


how to clone 9i Database on to 10g Database.

0 Answers  


what is normalisation?what are its uses?

0 Answers  


What are the oracle differences between nvl and coalesce

0 Answers  


why you need store procedure ? where do we use it in a Java project? can you get the code for as store procedure using in Java?

1 Answers   Goldman Sachs,


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • 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)