I am trying to list all the courses for a person, where the course code doesn't start with a 'C'. The following code is still bring up 'C-...' codes. Any idea how to fix it?
SELECT u.idnumber, u.firstname, u.lastname, r.id, c.idnumber AS m_name, c.id AS c_id
FROM mdl_user u
LEFT JOIN mdl_role_assignments r ON u.id = r.userid
LEFT JOIN mdl_context c1 ON r.contextid = c1.id
LEFT JOIN mdl_course c ON c1.instanceid = c.id
WHERE u.idnumber = 'a.smoth' AND NOT c.id LIKE 'C%'