Is there a Mysql command to make all the letters in a column lowercase? I have some names of places like London, Berlin, Prague etc and I've decided I want them written london, berlin and prague - and thought there must be a way to do it all at once? I tried this but it didn't work: SELECT LCASE(column_name) FROM `table_name`
I assume that you want the names stored in lowercase. If so, you need to UPDATE the columns. The SELECT statement simply returns the rows to the client, but leaves the contents unchanged.
If you actually want to update that column, then something along the lines of: update table_name set col_name = LOWER(col_name); should work i think.
This query will work only whenever you select the name, but it will update it in the table. You can do as wootty suggested or use LCASE() in the same fashion UPDATE table_name SET col_name = LCASE(col_name); Code (markup): Now you can select the name in lowercase like SELECT column_name FROM `table_name` Code (markup):
Thanks, I should have known that but I have such a blind spot for database stuff, my brain just freezes over. Added rep to you both.