Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • REPLACE(str,from_str,to_str) string function in MySQL

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 378
    Comment on it

    REPLACE(str,fromStr,toStr)

    When you want to replace a string from other string in a string then you can use REPLACE function. REPLACE function returns the string str with all occurrences of the string from Str and replace it by the string to Str. REPLACE() function is a case-sensitive match when searching for fromStr.

    mysql> SELECT REPLACE('Hello SQL','SQL','MySQL');
    +------------------------------------+
    | REPLACE('Hello SQL','SQL','MySQL') |
    +------------------------------------+
    | Hello MySQL                        |
    +------------------------------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT REPLACE('Hello SQL','sql','MySQL');
    +------------------------------------+
    | REPLACE('Hello SQL','sql','MySQL') |
    +------------------------------------+
    | Hello SQL                          |
    +------------------------------------+
    1 row in set (0.01 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: