LOWER function is used to convert upper case string to lower case string.
Syntax of LOWER Function :
LOWER ( character_expression )
character_expression is an expression of character or binary data. character_expression can be a constant, variable, or column.
Return type of LOWER function is varchar.
Examples of LOWER Function :
Example 1 : Use of LOWER function in select clause
SELECT LOWER('SynTax-Example')
Output
syntax-example
Above example returns specified string in lower case.
Example 2 : Use of LOWER function to display field value of table.
SELECT LOWER(ContactName) AS 'Customer Name'
FROM Customers
Output
Customer Name
maria anders
ana trujillo
antonio moreno
thomas hardy
christina berglund
hanna moos
Above example displays customer name in lower case of customer table.
Example 3 : Use of LOWER function in where clause
SELECT ContactName, CompanyName
FROM Customers
WHERE LOWER(ContactName) LIKE 'thomas %'
Output
ContactName CompanyName
Thomas Hardy Around the Horn
Above example displays customers having name as 'thomas'.