List user and correct group

Ri: Re: List user and correct group

by DarioDN DN -
Number of replies: 0
So, I tried to change the last inner join:
INNER JOIN mdl_groups AS g ON gm.groupid = g.id AND c.id = g.courseid

BUT, if a course doesn't have groups, the query results zero record ...