It would be immensely helpful if you'd post the query you've used, but anyway... I think I was able to get the results you're looking for with the following query
SELECT data_id, GROUP_CONCAT(CONCAT_WS(':', attribute_code, IDs) SEPARATOR '|') AS concatMess
FROM
(
SELECT data_id, attribute_code, GROUP_CONCAT(attribute_id SEPARATOR ',') AS `IDs`
FROM data
WHERE 1
GROUP BY attribute_code
) sq
GROUP BY data_id;
Note: The SEPARATOR ','
isn't really necessary, but I like to be explicit. Feel free to remove it
Results:
data_id concatMess
1 manufacturer:148
2 optics_finish:3673|optics_reticle:3923,3924