Created
January 11, 2013 11:07
-
-
Save ankitnetwork18/4509887 to your computer and use it in GitHub Desktop.
mysql: command to remove all blank spaces from records
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE | |
accounts_table | |
INNER JOIN | |
customers_table ON (accounts_table.user_id = customers_table.user_id) | |
SET | |
accountnumber = RTRIM(accountnumber) | |
WHERE | |
customers_table.customer_id = 'customer id'; | |
If you do not have many records in accounts_table, and you want to make sure that all the accountnumber values are trimmed, you can simply apply the trim to all the records as follows: | |
UPDATE | |
accounts_table | |
SET | |
accountnumber = TRIM(accountnumber); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment