How we can findout the Nth largest No from the table.

Showing Answers 1 - 3 of 3 Answers

sivaji

  • Sep 6th, 2006
 

select distinct sal from emp e where &n=(select count(distinct sal) from emp where e.sal<=sal);

  Was this answer useful?  Yes

piper

  • Oct 3rd, 2006
 

SELECT salary FROM employee ORDER BY salary LIMIT n-1, 1

  Was this answer useful?  Yes

himanshu

  • Oct 6th, 2006
 

is there any easier way of findin the solution..this query is too confusing... :)

  Was this answer useful?  Yes

WHAT IS NTH LARGEST IN THE SENSE .YOU WANT NTH LARGEST SALARY .YOU WANT ANY ANY OTHER THING .YOU SHOULD GIVE SOME SPECIFICATION .IN ORACLE YOU CAN FIND USINGROWNUM FUNCTION MINUS OPERATORLEVEL PSEUDO CLOLUMNINLINE VIEWSUSING ANALYTICA FUNCTIONS LIKE DENSE_RANK() ROWNUM()RANK()IF YOU WANT TO FIND USE PARTITION IN ANALATYTICAL FUNCTIONS TO KNOW MORE SEARCH IN ASKTOM PORTAL

  Was this answer useful?  Yes

Geetha

  • Nov 5th, 2007
 

Select distinct sal from emp e where &n=(select count(distinct sal) from emp where e.sal>=sal);

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions