本文介绍了Oracle-子查询与分析函数查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
-- One
select * from
(select
employeeid, effectivedate, designationid,
max(effectivedate) over (partition by employeeid) meffectivedate
from
designationtransfers
) where effectivedate = meffectivedate
-- Two
select employeeid, effectivedate, designationid from
designationtransfers t
where
effectivedate =
(select max(effectivedate) from designationtransfers t1 where t.employeeid = t1.employeeid)
上面两个查询的结果是相同的.但是,我不确定哪个是要使用的,哪个要优于另一个.
有人可以帮我吗?
预先谢谢您.
The result of the above two queries is the same. But, I am uncertain which is the one to use and which is better than the other.
Can anybody help me?
Thank you in advance.
推荐答案
这篇关于Oracle-子查询与分析函数查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!