Trim leading whitespace from a field in MySQL

As always, backup the database or at least the affected table before running a command that will change every record in a table as this does.

The following line will remove the leading spaces (note the parameter '\t'). For new lines use '\n' and for carriage returns use '\r'.

UPDATE members SET memberid = REPLACE(memberid,'\t','');

For more information, see