SELECT
CaseEvidenceTree.caseEvidenceTreeID,
CaseEvidenceTree.effectiveFrom,
CaseEvidenceTree.statusCode,
CaseEvidenceTree.previousEvidenceID,
CaseEvidenceGroupLink.caseEvidenceGroupLinkID,
CaseEvidenceGroupLink.relatedID,
CaseEvidenceGroupLink.evidenceType
INTO
:caseEvidenceTreeID,
:effectiveFrom,
:statusCode,
:previousEvidenceID,
:caseEvidenceGroupLinkID,
:relatedID,
:evidenceType
FROM
CaseEvidenceTree,
CaseEvidenceGroup,
CaseEvidenceGroupLink
WHERE CaseEvidenceGroupLink.relatedID IN
(
SELECT
relatedID
FROM
CaseEvidenceGroupLink
WHERE CaseEvidenceGroupLink.evidenceTypeInstanceID = (
SELECT
evidenceTypeInstanceID
FROM
CaseEvidenceGroupLink
WHERE CaseEvidenceGroupLink.caseEvidenceGroupLinkID = :caseEvidenceGroupLinkID
)
)
AND CaseEvidenceGroup.caseEvidenceGroupID = CaseEvidenceGroupLink.caseEvidenceGroupID
AND CaseEvidenceTree.caseEvidenceTreeID = CaseEvidenceGroup.caseEvidenceTreeID
ORDER BY effectiveFrom,
statusCode
|