DB column data is multiline data , now i need to get result in single line
DB : Mysql Table name :: master_countries
so i want output in a single line comma delimited:
SELECT REPLACE(country, '\n' ,',') FROM master_countries
DB column data is multiline data , now i need to get result in single line
DB : Mysql Table name :: master_countries
so i want output in a single line comma delimited:
SELECT REPLACE(country, '\n' ,',') FROM master_countries
SELECT id,GROUP_CONCAT(country) FROM master_countries GROUP BY id;
country has multiple values in it, OP is trying to split on new lines.Try this :
SELECT REPLACE(country, '\r\n' ,',') FROM master_countries
or
SELECT REPLACE(country, '\n\r' ,',') FROM master_countries
selects and alters on the fly.