Saturday, September 22, 2012

MySQL String Replace

Ref. http://stackoverflow.com/questions/1806949/mysql-query-to-replace-spaces-in-a-column-with-underscores



update photos set filename = replace(filename, ' ', '_');

ie, you search for ' ' in the column filename and use '_' instead ; and put the result back intofilename.

No comments:

Post a Comment