Collections:
RPAD() - Right-Padding String
How to pad a string at the right end using the RPAD() function?
✍: FYIcenter.com
RPAD(str, len, padstr) is a MySQL built-in function that
truncates a string or pad it at the right end to a given length.
For example:
SET @str = 'yahoo'; SELECT RPAD(@str, 8, 'o'); -- +--------------------+ -- | RPAD(@str, 8, 'o') | -- +--------------------+ -- | yahooooo | -- +--------------------+
Reference information of the RPAD() function:
RPAD(str, len, padstr): modstr Returns the string str, right-padded with the string padstr to a length of len characters. If str is longer than len, the return value is shortened to len characters. It returns NULL if any of its arguments are NULL. Arguments, return value and availability: str: Required. The string that will be searched in. len: Required. The number of characters to be truncated or right-padded to. padstr: Required. The substring to pad with. modstr: Return value. The modified string after truncating or padding. Available since MySQL 4.0.
Related MySQL functions:
⇒ RTRIM() - Right-Trimming String
2023-11-12, 1410🔥, 0💬
Popular Posts:
How to continue to the next iteration of a WHILE loop in SQL Server Transact-SQL? How to use CONTINU...
What Happens If the UPDATE Subquery Returns Multiple Rows in SQL Server? If a subquery is used in a ...
How To Select All Columns of All Rows from a Table in Oracle? The simplest query statement is the on...
How To Assign Debug Privileges to a User in Oracle? In order to run SQL Developer in debug mode, the...
What Is Transport Network Substrate (TNS) in Oracle? TNS, Transport Network Substrate, is a foundati...