REPLACE()

Overview

Replaces all occurrences of one string with another and returns the resulting string.

USAGE

REPLACE(string, find, replace)

Argument Name

Description

string

The source string

find

The string to find

replace

The replacement string

DETAILS

REPLACE() is a string function that returns the original string with all occurrences of the find string replaced by the replace string.

The search performs a case-sensitive match.

A NULL is returned if any argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT REPLACE('mcricdb', 'c', 'a');
+------------------------------+
| REPLACE('mcricdb', 'c', 'a') |
+------------------------------+
| mariadb                      |
+------------------------------+
SELECT REPLACE('FOO Foo foo is foo', 'foo', 'bar');
+---------------------------------------------+
| REPLACE('FOO Foo foo is foo', 'foo', 'bar') |
+---------------------------------------------+
| FOO Foo bar is bar                          |
+---------------------------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES