Database SQL Operation: CaseHeader.searchAndGroupByStatus
Description: | Count the number of cases for each statusCode, for example, 'Open', 'Active' etc |
Sterotype: | nsmulti |
SELECT
COUNT(*),
CaseHeader.statusCode
INTO
:numberOfRecords,
:statusCode
FROM
CaseHeader,
CaseUserRole,
OrgObjectLink
WHERE OrgObjectLink.userName = :userName
AND OrgObjectLink.orgObjectLinkID = CaseUserRole.orgObjectLinkID
AND CaseUserRole.caseID = CaseHeader.caseID
AND CaseUserRole.typeCode = :typeCode
GROUP
BY CaseHeader.statusCode
|