---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/function-ref/BETWEEN
  - ru/function-ref/BETWEEN
  - href: en/function-ref/BETWEEN.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: en/function-ref/BETWEEN.html
editable: false
vcsPath: en/function-ref/BETWEEN.md
---

# BETWEEN



#### Syntax {#syntax}


```
value [ NOT ] BETWEEN low AND high
```

#### Description {#description}
Returns `TRUE` if `value` is in the range from `low` to `high` inclusive.

The option `value NOT BETWEEN low AND high` returns the opposite value.

**Argument types:**
- `value` — `Date | Datetime | Fractional number | Integer | String`
- `low` — `Date | Datetime | Fractional number | Integer | String`
- `high` — `Date | Datetime | Fractional number | Integer | String`


**Return type**: `Boolean`

{% note info %}

Arguments `value`, `low`, `high` must be of the same type.

{% endnote %}


#### Examples {#examples}

```
3 BETWEEN 1 AND 100 = TRUE
```

```
100 BETWEEN 1 AND 100 = TRUE
```

```
3 NOT BETWEEN 1 AND 100 = FALSE
```

```
#2018-01-12# BETWEEN #2018-01-10# AND #2018-01-15# = TRUE
```

```
#2018-01-12 01:02:10# BETWEEN #2018-01-12 01:02:00# AND #2018-01-12 01:02:30# = TRUE
```


#### Data source support {#data-source-support}

`ClickHouse 21.8`, `Files`, `Google Sheets`, `Yandex Metrica`, `Microsoft SQL Server 2017 (14.0)`, `MySQL 5.7`, `Oracle Database 12c (12.1)`, `PostgreSQL 9.3`, `Trino`, `Yandex Documents`, `YDB`.
