Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Wednesday, 27 August 2014

Replace function in SQL

Replace function is use to replace a string to the string that we want. Replace function takes three parameter

Syntax of the replace function is:-

REPLACE ('STRING1','STRING2','STRING3');

Here:-

STRING1 is the values from which you need to replace a string.

STRING2 is the value by which you need to replace a string.

STRING3 is the values which is going to be replaced.

Example is:-

SELECT OREPLACE ('MYSELF','MY','');

O_REPLACE
----------------
SELF

SQL> SELECT OREPLACE ('MYSELF123','123',' CHANCHAL.');

O_REPLACE
----------------
MYSELF CHANCHAL.




Read Also:-  Replace function in Teradata
Please provide your feedback in the comments section above. Please don't forget to follow.