mysql select distinct rows into a comma delimited list column

Use GROUP_CONCAT() for this, with a GROUP BY covering the other three columns:

SELECT 
  name,   -- Microsoft
  other,  -- GGG
  other2, -- 1
  GROUP_CONCAT(id) AS ids
FROM tbl
GROUP BY name, other, other2

Leave a Comment