【发布时间】:2017-05-05 16:30:51
【问题描述】:
请任何人解释一下以下查询的运行时执行:-
select distinct sal
from emp e1
where 3 = (select count(distinct sal)
from emp e2
where e1.sal <= e2.sal);
【问题讨论】:
-
更好地解释你的问题.. ?
-
这是一种非常古老(且效率低下)的计算方法。看看
DENSE_RANK吧。