00)) mr      ON r.id = mr.id   INNER JOIN category_resource cr     ON r.id = cr.resource_id   INNER JOIN category c     ON cr.category_id = c.id   INNER JOIN user u     ON r.created_by = u.id GROUP BY r.id;