SELECT DISTINCT c.nombre_curso, c.cod_curso,
(SELECT COUNT(course.id)
FROM ssbiobio_moodle.mdl_role_assignments AS asg
JOIN ssbiobio_moodle.mdl_context AS context ON asg.contextid = context.id AND context.contextlevel = 50
JOIN ssbiobio_moodle.mdl_user AS USER ON USER.id = asg.userid
JOIN ssbiobio_moodle.mdl_course AS course ON context.instanceid = course.id
WHERE asg.roleid = 5
AND course.shortname = c.nombrecorto GROUP BY course.shortname) AS Estudiantes
FROM tbl_usuarios tu
JOIN tbl_inscripcion ti ON tu.id=ti.idusuario
JOIN tbl_cursos c ON c.nombrecorto=ti.nombrecortocurso
WHERE ti.idejecucion=''
384
PREVENCIÓN Y CONTROL DE INFECCIONES ASOCIADAS A LA ATENCIÓN EN SALUD IAAS 120