Tuesday, May 24, 2011

Nth HIGHEST IN A TABLE

-- Nth HIGHEST SALARY OF SCOTT.EMP TABLE

select SAL from
SCOTT.EMP a
where &p = (select count(distinct(b.SAL)) from SCOTT.EMP b where b.SAL>=a.SAL);

No comments:

Post a Comment