SQL LCASE Functions
The LCASE() function converts the value of a field to lowercase.
SQL LCASE() Syntax
SELECT LCASE(column_name) FROM table_nameNow we want to select the content of the "LastName" and "FirstName" columns above, and convert the "LastName" column to lowercase.
| ID | LastName | FirstName | Address | City |
|---|---|---|---|---|
| 1 | Smith | John | 22 Street | London |
| 2 | Jones | Mary | 55 Avenue | New York |
| 3 | Watson | Alfred | 66 Road | London |
We use the following SELECT statement:
SELECT LCASE(LastName) as LastName,FirstName FROM PersonsThe result-set will look like this:
| LastName | FirstName |
|---|---|
| smith | John |
| jones | Mary |
| watson | Alfred |