The LOWER() function in MySQL is used to convert all characters in a string to lowercase. It can be applied to string data types like CHAR, VARCHAR, and TEXT.
Syntax:
LOWER(string)
string: The string that you want to convert to lowercase.
Example:
SELECT LOWER('HELLO WORLD');
This will return:
hello world
You can also use LOWER() in queries to manipulate data, such as in filtering:
SELECT * FROM users WHERE LOWER(username) = 'john_doe';
This query will return all rows where the username is john_doe, ignoring the case of the input string in the username column.
No comments:
Post a Comment