i want to see all users and all their competencies in one table independent of the learning plan.
i was thinking about SQL:
SELECT user2.firstname AS Firstname,
user2.lastname AS Lastname,
user2.email AS Email,
comp.shortname AS "Competency",
WHEN cuc.grade = 2 THEN 'yes' WHEN cuc.grade = 1 THEN 'no' ELSE '-'
end as "grade"
FROM mdl_competency_usercomp AS cuc
INNER JOIN mdl_user AS user2 ON cuc.userid = user2.id
INNER JOIN mdl_competency AS comp ON cuc.competencyid = comp.id
ORDER BY user2.email;