Thursday, January 11, 2007

nth max salary in MySql

select max(sal) fom emp a where (n-1)=(select count(sal) from emp e where a.sal >= e.sal)

0 Comments:

Post a Comment

<< Home