I have a MySQL database table ‘photos’ with a column ‘filename’.
I need to replace the spaces in the filename column values with underscores.
Is it possible with a single/multiple query? If so how?
I have a MySQL database table ‘photos’ with a column ‘filename’. I need to
Share
You can use the
REPLACEfunction :So, to replace all occurences of a character by another one in all lines of a table, something like this should do :
ie, you search for ‘ ‘ in the column
filenameand use ‘_’ instead ; and put the result back intofilename.