How about:
On Mon, Sep 6, 2010 at 9:07 PM, [email protected] < [email protected]> wrote: > Find out nth highest salary from emp table > SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT > (b.sal)) FROM EMP B WHERE a.sal<=b.sal); > For Eg:- > Enter value for n: 2 > SAL > --------- > 3700 > > > select distinct(a.sal) from salary order by salary limit 1 offset <N>; Regards Rajeev J Sebastian -- "Freedom is the only law". "Freedom Unplugged" http://www.ilug-tvm.org You received this message because you are subscribed to the Google Groups "ilug-tvm" group. To control your subscription visit http://groups.google.co.in/group/ilug-tvm/subscribe To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For details visit the google group page: http://groups.google.com/group/ilug-tvm?hl=en
