select t1.requestid , t1.nodeid as 节点,t2.nodeid as 上一节点 ,
t2.operatedate as 接收日期 , t2.operatetime as 接收时间 ,t1.operatedate as 提交日期, t1.operatetime as 提交时间
from workflow_requestLog t1
left outer join workflow_requestLog t2 on t1.requestid=t2.requestid and t1.nodeid=t2.destnodeid and t1.LOGID>t2.LOGID
and t2.LOGID=(select max(LOGID) from workflow_requestlog where requestid=t1.requestid and destnodeid =t1.nodeid and LOGID< t1.LOGID )
在oracle中执行报错
t2.operatedate as 接收日期 , t2.operatetime as 接收时间 ,t1.operatedate as 提交日期, t1.operatetime as 提交时间
from workflow_requestLog t1
left outer join workflow_requestLog t2 on t1.requestid=t2.requestid and t1.nodeid=t2.destnodeid and t1.LOGID>t2.LOGID
and t2.LOGID=(select max(LOGID) from workflow_requestlog where requestid=t1.requestid and destnodeid =t1.nodeid and LOGID< t1.LOGID )
在oracle中执行报错
解决方案 »
- Win7旗舰Oracle11gr2的各项服务起什么作用?
- 【新手请教】关于oracle 导入dmp文件的问题!
- 帮忙写一下代码哇
- Oracle里用spool生成的csv文件如何把项目里的空格去掉?
- 如何写这个sql
- 请教一个sql(oracle)查询的问题
- 请问如何得到Oracle SQLException的errorCode, 用SQLException.getErrorcode() 总是返回0
- 执行Oracle Setup没反应!?
- 求救!!!sos!!
- 如何在基于90列,20多万条的表上建立视图?我的查询关联到该表,10分钟没有结束!!!!
- Oracle中Job与数据类型的基础问题
- 怎样做职场规划
select *
from workflow_requestLog t1,
(select t1.*
from workflow_requestLog t1
where t1.logid = (select max(v1.logid)
from workflow_requestLog v1
where t1.requestid = v1.requestid
and t1.nodeid = v1.nodeid)) t2
where t1.requestid = t2.requestid(+)
and t1.nodeid = t2.destnodeid(+);
接收日期 ,接收时间 ,提交日期,提交时间 FROM (
select t1.requestid , t1.nodeid as 节点,t2.nodeid as 上一节点 ,
t2.operatedate as 接收日期 , t2.operatetime as 接收时间 ,t1.operatedate as 提交日期, t1.operatetime as 提交时间,
MAX(T2.LOGID) OVER(PARTITION t2.requestid,t2.destnodeid) M,T2.LOGID
from workflow_requestLog t1
left join workflow_requestLog t2 on t1.requestid=t2.requestid and t1.nodeid=t2.destnodeid and t1.LOGID>t2.LOGID
) T WHERE T.M=T.LOGID ;