ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Subject:   how do we find nth highest in SQL
Date:   2004-12-11 08:16:41
From:   RuchirAwadhawal
Response to: how do we find nth highest in SQL

Query for Nth Max (Highest)
select sal from emp t
where &n = (select count(sal)
from (select distinct sal from emp)
where t.sal<=sal);


<b>Query for Nth Min (Lowest)
select sal from emp t
where &n = (select count(sal)
from (select distinct sal from emp)
where t.sal>=sal);


1 to 1 of 1
  1. query for nth max
    2007-08-25 02:05:46  kashif094 [View]

    • query for nth max
      2007-10-25 05:02:21  jolly_cet [View]

1 to 1 of 1