Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Cohorts & Audiences are commonly used to enrol users in courses, via the Cohort/Audience sync enrolment method. To identify the Cohorts/Audiences that have been used to enrol learners in course you can use the following query to create a derived table. 


Code Block
languagesql
titleCohort/Audience Enrolments
select c.id as cohortid, cm.userid as userid, e.courseid as courseid, c.name as cohort
FROM mdl_cohort c
JOIN mdl_cohort_members cm ON (cm.cohortid = c.id)
JOIN mdl_enrol e ON (e.customint1 = c.id)

...