ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

{µo°Ý}sql ¨â¬q»yªk²Õ¦¨¤@­Ó

{µo°Ý}sql ¨â¬q»yªk²Õ¦¨¤@­Ó

¦U¦ì¥ý¶i..¥i§_À°­Ó¦£
³o¨â¬q sql  ­n²Õ¦¨¤@¬q¡A­n¦p¦ó³sµ²°_¨Ó©O¡A¤p§Ì¸Õ¤F«Ü¤[¡A²Õ¥X¨Ó³£¤£¹ï
¥i§_À°²Õ¤@¤U¡A¨ÃÀu¤Æ¤@¤U...



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='¦Ûµû¶ñ¼g'
  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='¦Ûµû¶ñ¼g'
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-¤W¥b¦~'
    And PG0.umasterId='MH0433') AS B  
where
G0.formSerialNumber = B.m
And G0.depId= 'J010'
And ddate='2011-¤W¥b¦~'
And umasterId='MH0433'
AND Us.id = uid
¬O¾Çµ{¦¡¦Ó¤£¬O­nµ{¦¡¡A¬O¶i¨Bªº°ò¦

¸Ñ¥X¨Ó¤F
  1. select *
  2. from WorkItem W,ProcessInstance P ,
  3. (SELECT MAX(P1.createdTime  ) AS m  FROM WorkItem W1 ,ProcessInstance P1
  4.   Where  P1.contextOID= W1.contextOID
  5.   And P1.processDefinitionId='PerformanceAssessment_003'   
  6.   And  W1.workItemName='¦Ûµû¶ñ¼g'
  7.   And  W1.performerOID in (
  8. select  Us.OID,uid,ddate,depId,umasterId,cdepId
  9. from
  10. Users Us,
  11. PerformanceAssessment_007_Grid0 G0,
  12. (SELECT MAX(formSerialNumber) AS m  ,performerOID FROM PerformanceAssessment_007_Grid0 PG0
  13.    Where  PG0.depId ='J010'
  14.     And PG0.ddate='2011-¤W¥b¦~'
  15.     And PG0.umasterId='MH0433') AS C  
  16. where
  17. G0.formSerialNumber = C.m
  18. And G0.depId= 'J010'
  19. And ddate='2011-¤W¥b¦~'
  20. And umasterId='MH0433'
  21. AND Us.id = uid
  22. )
  23.   GROUP BY W1.performerOID) AS B  
  24. where
  25. P.contextOID=W.contextOID
  26. And P.processDefinitionId='PerformanceAssessment_003'   
  27. And workItemName='¦Ûµû¶ñ¼g'
  28. And performerOID in (B.performerOID)
  29. And P.createdTime =B.m
  30. And P.currentState in ('3','1')
½Æ»s¥N½X
¬O¾Çµ{¦¡¦Ó¤£¬O­nµ{¦¡¡A¬O¶i¨Bªº°ò¦

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD