Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Please explain this query

Please explain this query

From: shihab <shihabvk_at_gmail.com>
Date: 13 Oct 2005 01:39:54 -0700
Message-ID: <1129192794.052203.152600@z14g2000cwz.googlegroups.com>


This is the query to findout Nth Max (Highest) value from a table

SELECT sal from emp t
WHERE &n = (SELECT COUNT(sal)
FROM (SELECT DISTINCT sal FROM emp)
WHERE t.sal<=sal);

Can anybody expalin how this query works.....

Thanks in advance
Shihab Received on Thu Oct 13 2005 - 03:39:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US