List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 7 2002 2:09am
Subject:Re: triming white space from a TEXT column
View as plain text  
At 16:17 -0800 2/6/02, Richard Reina wrote:
>I am trying to trim both leading and trailing whitespace from a TEXT 
>column in my SELECT query.  I found the TRIM() command in the 
>manual, however, I can't get it to act upon a column name instead of 
>an actual string.  Can anyone help?

If you just say TRIM(col_name) it will return the trimmed column value,
but it won't change the column itself.  Try updating the column to its
trimmed value:

UPDATE tbl_name SET col_name = TRIM(col_name);

>
>Thanks,
>
>Richard


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread98783@stripped>
To unsubscribe, e-mail <mysql-unsubscribe-cyon=bestweb.net@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Thread
triming white space from a TEXT columnRichard Reina6 Feb
  • Re: triming white space from a TEXT columnPaul DuBois7 Feb
  • Re: triming white space from a TEXT columnRichard Reina7 Feb
    • Re: triming white space from a TEXT columnKeith C. Ivey7 Feb
Re: triming white space from a TEXT columnPaul DuBois12 Feb
Re: triming white space from a TEXT columnKeith C. Ivey12 Feb
Re: triming white space from a TEXT columnRichard Reina12 Feb