Have a look at LPAD
LPAD
Syntax: LPAD( var, padded_length ,x )
Parameters:
var -> String/Date Type/Number
x -> String/Date Type/Number
Return Type: String Value
Use Case
(i) If manager wants to know the salary of the employee in the neat format.
select first_name,lpad(salary,5,'*') from employees;
(ii) If the manager is interested in knowing the initials of the countries in which its organization has presence.
select lpad(upper(country_name),2) from countries;



Comments
Post a Comment