MySQL numeric functions
MySQL string functions
MySQL Date/Time functions
MySQL aggregate functions
MySQL flow control functions
The LOWER()
function in MySQL is a built-in function used to convert all the characters of a string to lowercase.
Here's a basic usage of the LOWER()
function:
SELECT LOWER('YOUR STRING');
For example, if you want to convert the string 'HELLO WORLD' to lowercase, you could use the LOWER()
function like this:
SELECT LOWER('HELLO WORLD');
The output of this query will be:
'hello world'
You can also use the LOWER()
function on table columns. For example, if you have a table employees
with a column name
, and you want to convert all names to lowercase, you could do something like this:
SELECT LOWER(name) FROM employees;
This query will return a list of all names in the employees
table, converted to lowercase.
You can also use the LOWER()
function in a WHERE
clause. For example, if you want to find all employees whose name is 'john', regardless of case, you could do something like this:
SELECT * FROM employees WHERE LOWER(name) = 'john';
This query will return all rows where the name
is 'john', regardless of whether the name is stored as 'John', 'JOHN', 'john', etc. in the database.
Note: LOWER()
is not case-sensitive, and works in the same way whether you write it as LOWER
, lower
, or any other combination of cases.
MySQL LOWER function example:
LOWER
function in MySQL is used to convert a string to lowercase.SELECT LOWER('Hello World') AS LowercasedString; -- Output: hello world
How to use LOWER function in MySQL:
LOWER
function to convert the case of a string to lowercase in MySQL.SELECT LOWER('MySQL is Great') AS LowercasedString; -- Output: mysql is great
Convert text to lowercase in MySQL:
LOWER
function is a convenient way to convert all characters in a text to lowercase.SELECT LOWER('Convert This Text') AS LowercasedText; -- Output: convert this text
Change case to lowercase with LOWER in MySQL:
LOWER
function to change the case of a string to lowercase in MySQL queries.SELECT LOWER(column_name) AS LowercasedColumn FROM your_table;
Using LOWER function for string manipulation in MySQL:
LOWER
function for string manipulation tasks where lowercase conversion is needed.SELECT LOWER(CONCAT('This', ' ', 'Is', ' ', 'Mixed', ' ', 'Case')) AS LowercasedString; -- Output: this is mixed case
LOWER vs LCASE in MySQL:
LOWER
and LCASE
functions in MySQL perform the same operation of converting a string to lowercase.LCASE
:SELECT LCASE('Case Insensitive') AS LowercasedString; -- Output: case insensitive
Convert column to lowercase in MySQL query:
LOWER
to convert the values of a specific column to lowercase in a MySQL query.SELECT LOWER(name) AS LowercasedName FROM users;
Examples of using LOWER function in MySQL queries:
LOWER
function in MySQL queries.SELECT LOWER('Example 1: Convert Me') AS Result1, LOWER('Example 2: Another String') AS Result2;