Search code examples
mysqlsqlsql-updatemariadblowercase

Change the text text-transform of the data in the column? [SQL]


The data contained in a column is stored in uppercase. Is it possible to automatically update all of the data in this column SYSLOCE2 with lowercase letters?

|---------------------|------------------|
|          ID         |     SYSLOCE2     |
|---------------------|------------------|
|          1          |       SAMPLE     |
|---------------------|------------------|
|          2          |       PEOPLE     |
|---------------------|------------------|
|          3          |       HELLO      |
|---------------------|------------------|
|          4          |       WORLD      |
|---------------------|------------------|

Solution

  • You can use lower(). It will convert all upper case letters in a string to the lowercase equivalent.

    UPDATE elbat
           SET sysloce2 = lower(sysloce2);