【SQL文字列関数】RPAD - 右側から指定した文字で充填する (Oracle)
Filed in SQL辞典 on 9月.01, 2009
Oracleで文字の末尾(右側)から指定した文字を充填するにはRPAD関数を使用します。
文法:
RPAD(word, n, x)
wordで指定した文字の長さがnになるように末尾からxの文字を充填する
使用例:文字が8ケタとなるように末尾に#を充填して調整する
SELECT word, RPAD(word, 8, ‘#’) FROM tbTestTable;
word RPAD(word, 8, ‘#’)
———————————————————-
people people##
NYC NYC#####
Windows Windows#
Leave a Reply
You must be logged in to post a comment.