mysql: remove duplicates that also contains a break space -


by mistake did insert in mysql rows contains duplicates, these duplicates not recognized because contain brak space

    eg.       | id | name    |        --------------       |  1 | apple   |       |  2 | apple{b}| //the {b} show cell contains break space 

so when try remove duplicates not recognized duplicates... , when try remove breaks error because name unique cell

what's best practice fix issue?

you can use regular expressions find or delete records containing space in end:

delete your_table name regexp '\s+$'; 

Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -