Lower Function In Sql in SQL
? LOWER Function in SQL
The LOWER function is used to convert all characters in a string to lowercase.
? Syntax:
LOWER(string)string: The text or column you want to convert to lowercase.
? Example:
SELECT LOWER('HeLLo WoRLD') AS lower_case;Result:
| lower_case |
|---|
| hello world |
? Use Case:
Helpful in case-insensitive comparisons:
SELECT * FROM usersWHERE LOWER(username) = 'john_doe';This ensures that JOHN_DOE, John_Doe, or john_doe will all match.
? Notes:
Supported in most databases:
? MySQL
? PostgreSQL
? SQL Server
? Oracle
Equivalent function:
SQL Server also supports
LOWER()Oracle:
LOWER()
Let me know if you want the opposite (UPPER) or more string functions!