Database 101: when using an aggregate function, be sure to put all non-aggregated fields into a Group By in the query, I'd neglected to do that. My query is now:And it works just fine.Code:Select u.UserID, u.EmailAddress, CONCAT(u.LastName,', ',u.FirstName) As 'FullName', GROUP_CONCAT(r.RoleTitle) As 'Roles', IF(u.Active, 'Y', 'N') As 'IsActive' From Users u Inner Join UserRoles ur On ur.UserID = u.UserID Inner Join Roles r On r.RoleID = ur.RoleID Group By u.UserID, u.EmailAddress, u.FirstName, u.LastName, u.Active Order By u.LastName, u.FirstName, u.UserID;




Reply With Quote