select *
from WorkItem W,ProcessInstance P ,
(SELECT MAX(P1.createdTime ) AS m FROM WorkItem W1 ,ProcessInstance P1
Where P1.contextOID= W1.contextOID
And P1.processDefinitionId='PerformanceAssessment_003'
And W1.workItemName='自評填寫'
And W1.performerOID in ('c7324cb4cd6a1004885f3408ccd4a6ff','ea0d8b04cd7e1004889adc3e5719cbd7','d9e70f44cd7d1004837699664bd98c42')
GROUP BY W1.performerOID) AS B
where
P.contextOID=W.contextOID
And P.processDefinitionId='PerformanceAssessment_003'
And workItemName='自評填寫'
And performerOID in ('c7324cb4cd6a1004885f3408ccd4a6ff','ea0d8b04cd7e1004889adc3e5719cbd7','d9e70f44cd7d1004837699664bd98c42')
And P.createdTime =B.m
And P.currentState in ('3','1')
select Us.OID,uid,ddate,depId,umasterId,cdepId
from
Users Us,
PerformanceAssessment_007_Grid0 G0,
(SELECT MAX(formSerialNumber) AS m FROM PerformanceAssessment_007_Grid0 PG0
Where PG0.depId ='J010'
And PG0.ddate='2011-上半年'
And PG0.umasterId='MH0433') AS B
where
G0.formSerialNumber = B.m
And G0.depId= 'J010'
And ddate='2011-上半年'
And umasterId='MH0433'
AND Us.id = uid作者: 暗黑 時間: 2011-5-28 10:43
解出來了
select *
from WorkItem W,ProcessInstance P ,
(SELECT MAX(P1.createdTime ) AS m FROM WorkItem W1 ,ProcessInstance P1
Where P1.contextOID= W1.contextOID
And P1.processDefinitionId='PerformanceAssessment_003'
And W1.workItemName='自評填寫'
And W1.performerOID in (
select Us.OID,uid,ddate,depId,umasterId,cdepId
from
Users Us,
PerformanceAssessment_007_Grid0 G0,
(SELECT MAX(formSerialNumber) AS m ,performerOID FROM PerformanceAssessment_007_Grid0 PG0
Where PG0.depId ='J010'
And PG0.ddate='2011-上半年'
And PG0.umasterId='MH0433') AS C
where
G0.formSerialNumber = C.m
And G0.depId= 'J010'
And ddate='2011-上半年'
And umasterId='MH0433'
AND Us.id = uid
)
GROUP BY W1.performerOID) AS B
where
P.contextOID=W.contextOID
And P.processDefinitionId='PerformanceAssessment_003'