
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.66 KB | hits: 13 | expires: Never
select c.id, c.shortname, g.name, gm.userid, u.username, r.enrol
from m_context j, m_course c, m_role_assignments r, m_role a, m_groups_members gm, m_groups g, m_user u
where j.contextlevel = 50
and j.id = r.contextid
and j.instanceid = c.id
and a.id = r.roleid
and r.userid = gm.userid
and r.userid = u.id
and g.id = gm.groupid
and c.id = g.courseid
and a.name = 'Student'
--and g.description = 'AUTO-GENERATED'
--and c.id = 11841
AND c.shortname ~ '^[A-Z]{4}[0-9]{5}_[0-9]{4}$'
and c.shortname = 'COMM11108_2102'
--AND substring(c.shortname from '[0-9]{4}$') >= '2102'
order by c.shortname, g.name, gm.userid
;