I always go with REPLACE(REPLACE(STRING, '\n', ''), '\r', ''), since depending on where your data came from there may be one or the other, or both. Although if there is a shorthand/more efficient way I'd love to hear it.

[EMAIL PROTECTED] wrote:
Ok.. I found the problem.. I needed to add a \r.. but now that opens up the question can I have a Multi replace search in replace?


Example can I do something like this in MySQL

REPLACE (STRING,'\r' or '\n',' ')


REPLACE(DESCRIPTION,'\r\n',' ')

Wishing you the best you know you deserve,

______________________





Hello Group,

Looking to use this REPLACE to strip multi line data out of my return data.
I am having problems getting the \n to work correctly, any ideas?

REPLACE(DESCRIPTION,\n,' ')


SELECT
rpad(CASE WHEN DESCRIPTION IS NULL THEN '' ELSE REPLACE(DESCRIPTION,'\n',' ') END,80,' ') as var
 FROM hardware;



Wishing you the best you know you deserve,

______________________
Lucas Heuman
CM Web Developer
SRA International, Inc.
FAA, WJHTC/Bldg 300, 2nd Fl., H33
Atlantic City Int'l Airport, NJ  08405
Phone 609.485.5401


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to