Greywacke Posted April 16, 2010 Share Posted April 16, 2010 hi there,what would the sql update query look like to remove new lines and carriage return characters from a text column? i've been searching the web but come up with nothing relative. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 16, 2010 Share Posted April 16, 2010 You would need to use one of the string functions, like replace:http://dev.mysql.com/doc/refman/5.0/en/string-functions.html Link to comment Share on other sites More sharing options...
Greywacke Posted April 16, 2010 Author Share Posted April 16, 2010 ah was simpler than i thought, updated with the following statements UPDATE 6_serviceleads SET text_LeadAttributes = REPLACE(text_LeadAttributes, "\n", "") WHERE text_LeadAttributes LIKE "%\n%";UPDATE 6_serviceleads SET text_LeadAttributes = REPLACE(text_LeadAttributes, "\r", "") WHERE text_LeadAttributes LIKE "%\r%"; issue resolved! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.