Home > database >  Everyone a great god, who can help me to convert MSSQL of the following statements to oracle?
Everyone a great god, who can help me to convert MSSQL of the following statements to oracle?

Time:10-20

Select t1 requestid, t1. The nodeid as nodes, t2. The nodeid as a node,
T2 operatedate as receiving date, t2. Operatetime as receiving time, t1. Operatedate as submitted date, t1, operatetime as submitted time
The from workflow_requestLog t1
Left outer join workflow_requestLog t2 on t1. Requestid=t2. The requestid and t1. The nodeid=t2. Destnodeid and t1. LOGID> T2. LOGID
And t2. LOGID=(select Max (LOGID) from workflow_requestlog where requestid=t1, requestid and destnodeid=t1. The nodeid and LOGID

In oracle perform error

CodePudding user response:

Statements can only see your parent have more than one, and you want to take logid the biggest, or suggest that you have the test data and rules to
 select * 
The from workflow_requestLog t1,
(select t1. *
The from workflow_requestLog t1
Where a t1. Logid=(select Max (v1. Logid)
The from workflow_requestLog v1
Where a t1. Requestid=v1. Requestid
And t1. The nodeid=v1. The nodeid) t2
Where a t1. Requestid=t2. Requestid (+)
And t1. The nodeid=t2. Destnodeid (+);

CodePudding user response:

The SELECT requestid, node, a node,
The receive date, time, delivery date, submit the FROM time (
Select t1 requestid, t1. The nodeid as nodes, t2. The nodeid as a node,
T2 operatedate as receiving date, t2. Operatetime as receiving time, t1. Operatedate as submitted date, t1, operatetime as submitted time,
MAX (T2) LOGID) OVER (PARTITION T2 requestid, T2. Destnodeid) M, T2. LOGID
The from workflow_requestLog t1
Left the join workflow_requestLog t2 on t1. Requestid=t2. The requestid and t1. The nodeid=t2. Destnodeid and t1. LOGID> T2. LOGID
) T WHERE T.M=T.L OGID;
  • Related