SELECT
PAApprovalRequest.plannedItemApprovalRequestID,
ApprovalRequest.requestedDate,
ApprovalRequest.requestedByUser,
ApprovalRequest.approvalDecisionDate,
ApprovalRequest.approvalDecisionByUser,
ApprovalRequest.status,
userRequested.fullName,
userDecision.fullName
INTO
:plannedItemApprovalRequestID,
:requestedDate,
:requestedByUser,
:approvalDecisionDate,
:approvalDecisionByUser,
:status,
:requestedByUserFullName,
:requestedDecisionByUserFullName
FROM
PAApprovalRequest,
Users userRequested,
ApprovalRequest
LEFT
JOIN
Users userDecision
ON userDecision.userName = ApprovalRequest.approvalDecisionByUser
WHERE PAApprovalRequest.plannedItemID = :plannedItemID
AND ApprovalRequest.approvalRequestID = PAApprovalRequest.approvalRequestID
AND userRequested.userName = ApprovalRequest.requestedByUser
|