Too Length(y) to Measure
LENGTH
Syntax: LENGTH ( string )
Parameters: The string to return the length for.
Return type: The LENGTH function returns a numeric value. If string is NULL, LENGTH function will return NULL.
Usage:
HR Manager has decided to assign cadre on the basis of the number of digits in the salary of employee. Manager to Data analyst: Bring me the list of all employees and the number of digits in their salaries. Data analyst runs below query to fetch the required data.
SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, LENGTH(SALARY) AS NO_OF_DIGITS FROM EMPLOYEES;
Comments
Post a Comment