SELECT ROWS WITH SIMILAR ID AND MERGE THE FILED VALUES IN ONE
You can use group concat for this. example

mysql&gt; select  * from dummy;
+----+-------+
| id | name  |
+----+-------+
|  1 | fiest |
|  1 | fiest |
|  1 | sec   |
+----+-------+
3 rows in set (0.00 sec)

mysql&gt; select group_concat(id) from dummy group by id;
+------------------+
| group_concat(id) |
+------------------+
| 1,1,1            |
+------------------+
1 row in set (0.00 sec)