Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 821 Bytes

File metadata and controls

24 lines (18 loc) · 821 Bytes
description
Removes all occurrences of a specified substring and replaces them with another string.

REPLACE

Syntax

REPLACE(string_expression varchar, pattern varchar, replacement varchar) → varchar

  • string_expression: String expression in which to do the replacements.
  • pattern: The substring you want replaced in the string_expression.
  • replacement: The string to replace the occurrences of the pattern substring with.

Examples

{% code title="REPLACE example" %}

SELECT REPLACE('THE CATATONIC CAT', 'CAT', 'DOG')
-- sample return 1

{% endcode %}