Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Brief introduction of oracle LPAD and RPAD functions

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The lpad function fills the string from the left with the specified characters

Basic syntax: lpad (string, padded_length, [pad_string])

String: the string to be populated

Padded_length: the length of the populated string, that is, the length returned by this function. If this number is shorter than the length of the original string, the lpad function will truncate the string into n characters from left to right.

Pad_string: fill in the string, which is an optional parameter, which is to be pasted to the left of string. If this parameter is not written, the lpad function will paste a space to the left of string.

Example 1:SQL > select lpad ('abcde',10,'x') from dual;LPAD (' ABCDE',10,'X')-xxxxxabcde sample 2:SQL > select lpad ('abcde',2) from dual The LPAD ('ABCDE',2)-abrpad function fills the string with the specified characters from the right. The syntax format is the same as the lpad format example: rpad (' tech', 2); will return 'te'rpad (' tech', 8,'0'); will return 'tech0000'rpad (' tech on the net', 15,'z') Will return 'tech on the net'rpad (' tech on the net', 16,'z'); will return 'tech on the netz'

Original address: http://bbs.delit.cn/thread-160-1-1.html

Please indicate the source of the reprint

Written by: measurement Technology http://www.delit.cn

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report