It should work fine. These should execute fine on your server: create table yourtable(yourfield varchar(256)); insert into yourtable(yourfield) values (' This needs to be trimmed '); update yourtable set yourfield = trim(yourfield); select * from yourtable;
I'm running version 4.1.9, but I think trim() was supported long time ago. --- John Berman <[EMAIL PROTECTED]> wrote: > Thanks for this > > > I did this: > > update mc_census set surname = trim(surname) > > however it fails with a syntax error ? > > I'm on 4.1 > > Regards > > John B > > -----Original Message----- > From: Homam S.A. [mailto:[EMAIL PROTECTED] > Sent: 11 February 2005 21:29 > To: mysql@lists.mysql.com > Subject: Re: Remove spaces > > update your_table > set your_field = trim(your_field) > > > --- John Berman <[EMAIL PROTECTED]> > wrote: > > > Hi > > > > I have a table with a number of fields > > > > The table is already populated, however some > entries > > have got spaces both > > before and after the data. > > > > Future imports into the table will have the spaces > > removed, however im still > > stuck with my extra spaces. > > > > I have checked the Mysql manual but could not > figure > > out how to remove the > > extra spaces that are already in the dbase ? > > > > > > Any help appreciated. > > > > Regards > > > > > > John B > > > > > > > > -- > > No virus found in this outgoing message. > > Checked by AVG Anti-Virus. > > Version: 7.0.300 / Virus Database: 265.8.7 - > Release > > Date: 10/02/2005 > > > > > > > > -- > > MySQL General Mailing List > > For list archives: http://lists.mysql.com/mysql > > To unsubscribe: > > > http://lists.mysql.com/[EMAIL PROTECTED] > > > > > > > > > __________________________________ > Do you Yahoo!? > Meet the all-new My Yahoo! - Try it today! > http://my.yahoo.com > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > > -- > No virus found in this incoming message. > Checked by AVG Anti-Virus. > Version: 7.0.300 / Virus Database: 265.8.7 - Release > Date: 10/02/2005 > > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.300 / Virus Database: 265.8.7 - Release > Date: 10/02/2005 > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]