SQL查询找到第N个最高薪水

我指的是以下查询来查找员工的第N个最高薪水. select sal from emp t where n = (select count(sal) from (select distinct sal from emp) where t.sal=sal); 一位先生说这个查询有效.有人可以解释如何将COUNT(实际上是1到X之间的值,其中X是完全不同的工资)等

返回顶部