Thursday, April 27, 2017

LOWER() in SQL Server


SQL LOWER() function converts all the characters in the expression specified to lowercase. LOWER() is used to change the case of characters/letters to lower case. Non textual characters in the string are not affected the LOWER() function. If the characters are already in lower case, the same will be returned as output. LOWER() does not works on NULL Values, NULL values are not considered.



Syntax:

     
            SELECT LOWER(expression)
           

expression is the text whose case is to be changed to lower case.



Example 1:
LOWER() on numeric column.

SELECT * FROM TempEmployeePayHistory


SELECT Rate, LOWER(Rate) FROM TempEmployeePayHistory


Example 2:
LOWER() on column with NULL values.

          SELECT * FROM TempEmployeePayHistory



SELECT Rate, LOWER(Rate) FROM TempEmployeePayHistory



Example 3:
LOWER() on text column.

          SELECT * FROM DatabaseLog



          SELECT DISTINCT [Event], LOWER([Event]) FROM DatabaseLog



Share This
Previous Post
Next Post

TekGrabs, established in 2017, is in the business of sharing Information. It provides news, articles and photos about the different technologies, inventions in different domains. Provides information on programming and databases.

0 comments: