RPAD() Function in MySQL Last Updated : 21 Jun, 2021 Comments Improve Suggest changes Like Article Like Report RPAD() function in MySQL is used to pad or add a string to the right side of the original string. Syntax : RPAD(str, len, padstr) Parameter : This function accepts three parameter as mentioned above and described below : str : The actual string which is to be padded. If the length of the original string is larger than the len parameter, this function removes the overfloating characters from string. len : This is the length of a final string after the right padding. padstr : String that to be added to the right side of the Original Str. Returns : It returns a new string of length len after padding. Example-1 : Applying RPAD() Function to a string to get a new padded string. SELECT RPAD("geeksforgeeks", 20, "*") AS RightPaddedString; Output : RightPaddedStringgeeksforgeeks******* Example-2 : Applying RPAD() Function to a string when the original string is larger than the len parameter. SELECT RPAD("geeksforgeeks", 10, "*") AS RightPaddedString; Output : RightPaddedStringgeeksforge Example-3 : Applying RPAD() Function to a string column in a table : Table - Student_Details : Student_IdNameMarks1Tarun Saha4302Nilima Mondal4253Sanya Jain4504Amit Sharma460 SELECT RPAD(Name, 15, "#") AS RightPadStudentName FROM Student_Details; Output : RightPadStudentNameTarun Saha#####Nilima Mondal##Sanya Jain#####Amit Sharma#### Comment More infoAdvertise with us Next Article RPAD() Function in MySQL J jana_sayantan Follow Improve Article Tags : DBMS SQL mysql Similar Reads RAND() Function in MySQL The RAND() function in MySQL is used to a return random floating-point value V in the range 0 <= V < 1.0. If we want to obtain a random integer R in the range i <= R < j, we have to use the expression : FLOOR(i + RAND() * (j â i)). Syntax : RAND(N) Parameter : This method accepts only on 3 min read ORD() Function in MySQL ORD() function in MySQL is used to find the code of the leftmost character in a string . If the leftmost character is not a multibyte character, it returns ASCII value. And if the leftmost character of the string str is a multibyte character, ORD returns the code for that character, calculated from 3 min read ROUND() Function in MySQL The ROUND() function in MySQL is used to round a number to a specified number of decimal places. If no specified number of decimal places is provided for round-off, it rounds off the number to the nearest integer. Syntax ROUND(X, D) Parameter Explanation This method accepts two parameters in the syn 2 min read REPLACE() Function in MySQL The REPLACE() function in MySQL is a powerful tool for string manipulation, allowing users to substitute specific substrings within a larger string. This functionality is particularly useful in various applications such as updating text data, cleaning up input or adjusting content in a database. In 3 min read SPACE() Function in MySQL SPACE() function in MySQL is used to return a string consisting of specified empty space characters. Syntax : SPACE(num) Parameter : This method accepts one parameter as mentioned above and described below : num : It is an integer which indicates how many spaces are being contained. Returns : It ret 1 min read Like