delimiter - How do I delimit a fetched data record on MySQL? -
i have column returns pipeline delimited records below:
'fromstate=a|count=5|highlimit=b|status=c|presentvalue=d|alarmvalue=e'
is there way have more formatted output like:
'fromstate=a count=5 highlimit=b status=c presentvalue=d alarmvalue=e' i.e.,
- pipelines replaced
- each value on new line (optional)
use string replace function of mysql
select replace('www.mysql.com', 'w', 'ww'); -> 'wwwwww.mysql.com' or check out function need: https://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
in case might want replace | \n or \r.
select replace(column, '|', '\r');
Comments
Post a Comment