http://blog.csdn.net/woshixuye/article/details/17262307
First, Lpad function
The Lpad function populates the left string with some specific characters with the following syntax: Lpad (string,n,[pad_string])
String
Character or parameter
N
The length of the character is the number of strings returned, and if this number is shorter than the length of the original string, the Lpad function will intercept the string as a left-to-right n character;
Pad_string
Optional parameter, this string is to be pasted to the left of the string, if this argument is not written, the Lpad function will paste a space on the left side of the string.
Lpad (' Tech ', 7); will return ' tech '
Lpad (' Tech ', 2); will return ' Te '
Lpad (' Tech ', 8, ' 0 '); will return ' 0000tech '
Lpad (' Tech on the net ', ' Z '); Will return ' Tech on the net '
Lpad (' Tech on the net ', +, ' z '); will return ' Ztech on the net '
Second, Rpad function
The Rpad function populates the right string with some specific characters with the following syntax: Rpad (string,n,[pad_string])
String
Character or parameter
N
The length of the character is the number of strings returned, and if this number is shorter than the length of the original string, the Lpad function will intercept the string as a left-to-right n character;
Pad_string
Optional parameter, this string is to be pasted to the right of the string, if this argument is not written, the Lpad function will paste a space on the right side of the string.
Rpad (' Tech ', 7); will return ' tech '
Rpad (' Tech ', 2); will return ' Te '
Rpad (' Tech ', 8, ' 0 '); will return ' tech0000 '
Rpad (' Tech on the net ', ' Z '); Will return ' Tech on the net '
Rpad (' Tech on the net ', +, ' z '); Will return ' tech on the Netz '
Use of Lpad functions and RPAD functions in Oracle