Here you go try this procedure :
DELIMITER //
CREATE PROCEDURE ProcedureName()
BEGIN
SELECT id,GROUP_CONCAT(product) FROM sample group by id;
END //
DELIMITER ;
It is not well tested I believe you can debug it. For reference you can go through the following tutorial it will give you basic idea : Mysql Store Procedure Tutorial