The Lpad function fills the string with the specified character from the left
basic Syntax: Lpad (String, Padded_length, [pad_string])
String : Preparing the filled strings
Padded_length: The length of the string after padding, that is, the length of the string returned by the function, if the 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: Fills the string, is an optional argument, the string is to be pasted to the left of the string, if this parameter is not written, the Lpad function will paste the space on the left side of the string
Example 1:sql> Select Lpad (' ABCDE ', ten, ' X ') from dual; Lpad (' ABCDE ', ten, ' X ')--------------------xxxxxabcde example 2:sql> select Lpad (' ABCDE ', 2) from dual; Lpad (' ABCDE ', 2)---------------The Abrpad function fills the string with the specified character from the right, with the same syntax format as the LPAD format: 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 '
Original address: http://bbs.delit.cn/thread-160-1-1.html
Reprint please indicate the source
Author: metric Technology http://www.delit.cn
Introduction to Oracle Lpad and RPAD functions