Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • RPAD(str,len,padstr) mysql function

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 255
    Comment on it

    RPAD(str,len,padstr)

    RPAD mysql function returns the string str, right-padded with the string padstr to a length of len characters means if you want to get a string to a given length and if the length of string is sorter than add the given character in to string at the place of the remain length. RPAD the return value is shortened to len characters If str is longer than len.

    mysql> SELECT RPAD('Hello MySQL',15,'*');
    +----------------------------+
    | RPAD('Hello MySQL',15,'*') |
    +----------------------------+
    | Hello MySQL****            |
    +----------------------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT RPAD('Hello MySQL',5,'*');
    +---------------------------+
    | RPAD('Hello MySQL',5,'*') |
    +---------------------------+
    | Hello                     |
    +---------------------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT RPAD('Hello MySQL',10,'*');
    +----------------------------+
    | RPAD('Hello MySQL',10,'*') |
    +----------------------------+
    | Hello MySQ                 |
    +----------------------------+
    1 row in set (0.00 sec)
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: