TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

MySQL RPAD Function

Overview

In this tutorial, we will learn about MySQL RPAD Function with some examples. We can use this function to right pad with padding characters until it reaches the specified length of characters.

Syntax

RPAD() function returns the string with the specified characters as right padded to the original given string until it reaches the length.

The general syntax of the function is as follows:

RPAD(<string>,<length>,<padding>)

Examples

Let’s use the function and check the output of the function in this example.

mysql> SELECT RPAD(‘MySQL’,20,’ *’);

+———————-+
| RPAD(‘MySQL’,20,’*’) |
+———————-+
| MySQL*************** |
+———————-+
1 row in set (0.00 sec)

MySQL RPAD Function

In this example, let’s use the Country database table from the world MySQL database.
The column is the Name column that contains the country name. We will right pad the column values
with the * character. We will filter the rows and retrieve only the rows of the Africa continent.

mysql> SELECT Name, RPAD(Name,25,’*’)
-> FROM Country
-> WHERE Continent=’Africa’;

MySQL RPAD Function Database Example

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

MySQL Workbench Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL Command-line Client

MySQL /

Command-Line MySQL Client

Start MySQL Client

MySQL /

Start MySQL Client on Windows 11

Windows 11 Services Run Prompt

MySQL /

Start MySQL Server on Windows 11

MySQL Community Downloads TDocs

MySQL /

Download & Install MySQL on Windows 11

‹ MySQL INSTR Function› MySQL LOWER Function

Recent Posts

  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • RAPTOR Editions
  • Flowgorithm Conditional Breakpoint Statement
  • Flowgorithm Read Numbers from File Example
  • Search Text File Flowchart Example
  • Flowgorithm Turtle Graphics Symbols
  • Draw Circle using Flowgorithm Turtle
  • Draw Parallel Lines using Flowgorithm Graphics

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version