Tuesday 2 August 2016

REPLACE: Replace a string with other string



REPLACE(string, sourceString, destinationString): REPLACE takes a string, srcString and destinationString, replace every occurrence of srcString with destinationString.

mysql> SELECT REPLACE("Hello ptr, How are you ptr", "ptr", "krishna");
+---------------------------------------------------------+
| REPLACE("Hello ptr, How are you ptr", "ptr", "krishna") |
+---------------------------------------------------------+
| Hello krishna, How are you krishna                      |
+---------------------------------------------------------+
1 row in set (0.00 sec)





Previous                                                 Next                                                 Home

No comments:

Post a Comment