Let's review LOWER function!
LOWER
Syntax: lower(variable)
Parameters: variable -> String/Date Type/Number Type/Character
Return Type:
If the variable is String/Char type than it gets converted into lower case.
If the variable is Number Type/Date Type then it gets converted into String type(VARCHAR) without impacting its value.
If the variable is Number Type/Date Type then it gets converted into String type(VARCHAR) without impacting its value.
Usage/ Used Cases
To get valid email ID: Email ids are always in lower case. However, due to typing mistake, someone might have entered it in upper case. So, in order to ensure that we have valid email for comparison or for report preparation.
Data analyst runs below query to fetch the required data.
SELECT LOWER(EMAIL) AS VALID_EMAIL FROM EMPLOYEES;
Comments
Post a Comment