Last active
October 23, 2023 13:07
-
-
Save michaelmeneses/107399513813f008ccdb675eb6d9f714 to your computer and use it in GitHub Desktop.
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
SELECT c.id as courseid, cfield.id as fieldid, cdata.value | |
FROM mdl_user_enrolments ue | |
JOIN mdl_enrol e ON e.id = ue.enrolid | |
JOIN mdl_course c ON c.id = e.courseid | |
JOIN mdl_course_categories cat ON cat.id = c.category | |
JOIN mdl_competency_coursecomp ccomp ON ccomp.courseid = c.id | |
JOIN mdl_competency comp ON comp.id = ccomp.competencyid | |
JOIN mdl_context ctx ON ctx.instanceid = c.id AND ctx.contextlevel = 50 | |
JOIN mdl_customfield_data cdata ON cdata.contextid = ctx.id | |
JOIN mdl_customfield_field cfield ON cfield.id = cdata.fieldid AND cfield.shortname = 'casa' | |
WHERE ue.userid = 97237 | |
AND comp.id IN (2997,3472,4385,4669,4981,5799,6228,8622,9688,10301,10302,15781,17214,19778,1312) | |
LIMIT 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment