LPAD

=LPAD =

Syntax
LPAD([expression],[expression],'[expression]')

 

Description
LPAD is used when you want to pad a number with a sign next to it.For example a number sign. Also This is efficant to represent money. .

//EXAMPLE//
SELECT LPAD(salary, 10,'*') FROM employees
 * LPAD(SALARY,10,'*') ||
 * *24000 ||
 * *17000 ||
 * *17000 ||
 * **4400 ||

SELECT LPAD(salary, 10, '-') FROM employees
 * LPAD(SALARY,10,'-') ||
 * -24000 ||
 * -17000 ||
 * <span style="font-family: 'Courier New', Courier, monospace;">-17000 ||
 * <span style="font-family: 'Courier New', Courier, monospace;">--4400 ||

<span style="font-family: 'Courier New', Courier, monospace;">SELECT LPAD(salary, 7, '$') FROM dual
 * <span style="font-family: 'Courier New', Courier, monospace;">LPAD(salary, 7, '$') ||
 * <span style="font-family: 'Courier New', Courier, monospace;">$$$$$$$24000 ||
 * <span style="font-family: 'Courier New', Courier, monospace;">$$$$$$$17000 ||
 * <span style="font-family: 'Courier New', Courier, monospace;">$$$$$$$17000 ||
 * <span style="font-family: 'Courier New', Courier, monospace;">$$$$$$$4400 ||