MySQL LOWER() Function
The LOWER()
function in MySQL is a simple yet useful string manipulation function that converts a given string to lowercase.
LOWER(): Definition and Usage
This function is commonly used for case-insensitive comparisons or for standardizing text data. It's a fundamental tool for data cleaning and preprocessing.
Equivalent Function
The LCASE()
function is exactly the same as LOWER()
; they both perform the same lowercase conversion.
Syntax
Syntax
LOWER(text)
Parameter Values
Parameter | Description |
---|---|
text |
The string you want to convert to lowercase. This is required. |
Examples
Converting a Literal String
This example converts a literal string to lowercase.
Syntax
SELECT LOWER("SQL Tutorial is FUN!");
Output
sql tutorial is fun!
Converting a Column Value
This example shows how to convert the values in a column of a table to lowercase.
Syntax
SELECT LOWER(CustomerName) AS LowercaseCustomerName
FROM Customers;
Output
(A table with a new column "LowercaseCustomerName" containing the lowercase versions of the "CustomerName" column)