---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/function-ref/REPLACE_ARRAY
  - ru/function-ref/REPLACE_ARRAY
  - href: ru/function-ref/REPLACE_ARRAY.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: ru/function-ref/REPLACE_ARRAY.html
editable: false
vcsPath: ru/function-ref/REPLACE_ARRAY.md
---

# REPLACE (массивы)

_Функция `REPLACE` также доступна в следующих категориях: [Строковые функции](REPLACE.md)._

#### Синтаксис {#syntax}


```
REPLACE( array, old, new )
```

#### Описание {#description}
Заменяет в массиве `array` все элементы, равные `old`, на `new`.

**Типы аргументов:**
- `array` — `Массив дробных чисел | Массив целых чисел | Массив строк`
- `old` — `Дробное число | Целое число | Строка`
- `new` — `Дробное число | Целое число | Строка`


**Возвращаемый тип**: Совпадает с типом аргументов (`array`)

#### Пример {#examples}



| **[array]**               | **REPLACE([array], 300, -1)**   | **REPLACE([array], NULL, 0)**   |
|:--------------------------|:--------------------------------|:--------------------------------|
| `'[100,300,200,100,300]'` | `'[100,-1,200,100,-1]'`         | `'[100,300,200,100,300]'`       |
| `'[100,300,NULL,NULL]'`   | `'[100,-1,NULL,NULL]'`          | `'[100,300,0,0]'`               |
| `'[150,NULL,130,192]'`    | `'[150,NULL,130,192]'`          | `'[150,0,130,192]'`             |




#### Поддержка источников данных {#data-source-support}

`ClickHouse 21.8`, `Файлы`, `Google Sheets`, `PostgreSQL 9.3`, `Trino`, `Яндекс Документы`.
