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.,

  1. pipelines replaced
  2. 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

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -