How to merge column in mysql depending on match
SELECT column1,column2,column3
MAX(CASE WHEN name='foo' THEN data ELSE 0 END)as foo,
MAX(CASE WHEN name='foo2' THEN data ELSE 0 END)as foo2,
MAX(CASE WHEN name='foo3' THEN data ELSE 0 END)as foo3
FROM tableName
GROUP BY column3