Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
65 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,19 @@ | ||
WITH QUALS_RAW AS | ||
( | ||
SELECT | ||
STAFF.STAFF_NUMBER, | ||
QUALIFICATION, | ||
QUALIFICATION_TYPE.QUALIFICATION_TYPE, | ||
institute.institute AS "QUALIFICATION_INSTITUTE", | ||
TO_CHAR(QYEAR) AS "QYEAR" | ||
|
||
FROM QUALIFICATION | ||
|
||
LEFT JOIN CONTACT ON CONTACT.CONTACT_ID = QUALIFICATION.CONTACT_ID | ||
LEFT JOIN STAFF ON QUALIFICATION.CONTACT_ID = STAFF.CONTACT_ID | ||
LEFT JOIN QUALIFICATION_TYPE ON QUALIFICATION_TYPE.QUALIFICATION_TYPE_ID = QUALIFICATION.QUALIFICATION_TYPE_ID | ||
LEFT JOIN institute ON institute.institute_id = qualification.institute_id | ||
|
||
WHERE CONTACT.CONTACT_ID = [[mainquery.contact_id]] | ||
) | ||
|
||
SELECT | ||
STAFF_NUMBER, | ||
LISTAGG(QUALIFICATION || ' (' || QUALIFICATION_TYPE || ' - ' || CASE WHEN QYEAR IS NULL THEN 'Year Unknown' ELSE QYEAR END || ')', ', ') WITHIN GROUP(ORDER BY STAFF_NUMBER) "ALL_QUALIFICATIONS" | ||
|
||
FROM QUALS_RAW | ||
|
||
GROUP BY STAFF_NUMBER | ||
SELECT * FROM quals_raw ORDER BY QYEAR DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.