为什么以下查询返回"零"记录:
SELECT * FROM records WHERE rownum >= 5 AND rownum <= 10
OR
SELECT * FROM records WHERE rownum >= 5
以下查询返回正确的记录:
SELECT * FROM records WHERE rownum <= 15
问候,
- Ashish
任何人都可以解释以下查询获得3个最高薪水吗?
select distinct sal
from emp a
where 3 >= (select count(distinct sal)
from emp b
where a.sal <= b.sal)
order by a.sal desc;
Run Code Online (Sandbox Code Playgroud)
有人建议我使用上面的查询来获得3个最大值.表中的工资.我不明白查询的下面部分发生了什么:
3>= (select count(distinct sal)
from emp b
where a.sal <= b.sal) ;
Run Code Online (Sandbox Code Playgroud)
有人能解释一下吗?如果还有其他方法可以得到相同的结果,请咨询我