Correlated query:
1.[sql]select sal from emp e where 1=(select count(distinct(sal)) from emp where e.sal<sal);[/sql]
this gives the exact second heighest value
2.[sql]select sal from emp e where &(n-1)=(select count(distinct(sal)) from emp where e.sal<sal);[/sql]
this gives the nth heighest value from atable
k.lakshmi_narayana@yahoo.co.in