Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Please explain this query
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
![]() |
![]() |