: SELECT   r.id, r.title,   u.name AS 'created_by',   GROUP_CONCAT( CONCAT(CAST(c.id as CHAR),',',c.name,',',c.value) separator ';') AS 'Categories' FROM   resource r   INNER JOIN  /*Select matching records as a table*/ 