Thursday, March 17, 2005, Marius Bocean wrote:
> i have a table in my mysql database. one column on my table contain
> information separated by spaces. i'dd like to eliminate those spaces, and i
> want to do that with an sql command(not using php). is there any funtion
> (like trim in php) who could do that?
> please help!
---
>From MySQL Help:
REPLACE(str,from_str,to_str)
Returns the string str with all all occurrences of the string from_str replaced
by the string to_str:
mysql> select REPLACE('www.mysql.com', 'w', 'Ww');
-> 'WwWwWw.mysql.com'
This function is multi-byte safe.
So: REPLACE(column, ' ', '')
HTH,
--
Geoff Lane
Cornwall, UK
The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/