The LCASE() function converts the value of a field to lowercase.
SQL LCASE() Syntax
SELECT LCASE(column_name) FROM table_name
Now 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 | |
We use the following SELECT statement:
SELECT LCASE(LastName) as LastName,FirstName FROM Persons
The result-set will look like this:
LastName | FirstName |
---|
smith | John |
jones | Mary |
watson | Alfred |
Link/cite this page
If you use any of the content on this page in your own work, please use the code below to cite this page as the source of the content.
<a href="https://www.afterhoursprogramming.com/tutorial/sql/sql-lcase-function/">SQL LCASE Function</a>
Stewart, Suzy. "SQL LCASE Function". After Hours Programming. Accessed on October 26, 2024. https://www.afterhoursprogramming.com/tutorial/sql/sql-lcase-function/.
Stewart, Suzy. "SQL LCASE Function". After Hours Programming, https://www.afterhoursprogramming.com/tutorial/sql/sql-lcase-function/. Accessed 26 October, 2024.
Stewart, Suzy. SQL LCASE Function. After Hours Programming. Retrieved from https://www.afterhoursprogramming.com/tutorial/sql/sql-lcase-function/.