How to Return Query Results as a Comma Separated in MySQL
The GROUP_CONCAT() function was built specifically for the purpose of concatenating a query’s result set into a list separated by either a comma or a delimiter of your choice.
SELECT CountryCode , GROUP_CONCAT(District) AS 'District' FROM city WHERE CountryCode = 'IND' GROUP BY CountryCode;