Replaces all occurrences of a substring with a new string. Replacement is case-sensitive.
STRINGDiperbarui: 13 Jun 2026REPLACE(value, old_string, new_string)The source string
The substring to be replaced
The replacement string
1 SELECT REPLACE('Hello World', 'World', 'BigQuery') as result;
Replaces a substring.
1 SELECT 2 REPLACE(REPLACE(REPLACE(phone, '-', ''), ' ', ''), '+', '') as clean_phone 3 FROM `project.dataset.contacts`;
Removes formatting characters from a phone number.
| clean_phone |
|---|
| 6281234567890 |
1 SELECT 2 LOWER(REPLACE(REPLACE(title, ' ', '-'), '--', '-')) as slug 3 FROM `project.dataset.articles`;
Creates a URL slug from a title.
Sudah paham REPLACE? Latih langsung di browser
Latihan interaktif, langsung di browser.