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

advertisement

AddThis Social Bookmark Button
Article:
  SQL Data Types
Subject:   Why doesn't the following query return me the nth highest value?
Date:   2005-07-28 07:34:41
From:   Suneel_Gundlapalli
select rownum,sal from (select distinct sal from emp order by sal desc) where rownum=&n;


the above query is not working. When I issue the following query, i get salaries ranked properly.


select rownum,sal from (select distinct sal from emp order by sal desc);


Its only working for the rownum=1.
Pls respond.


1 to 1 of 1
  1. Why doesn't the following query return me the nth highest value?
    2006-03-27 12:25:24  jaipalreddy [View]

1 to 1 of 1