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

# Comparison



#### Syntax {#syntax}

Equality
```
value_1 = value_2
```
Inequality
```
value_1 != value_2
```
Less than
```
value_1 < value_2
```
Less than or equal
```
value_1 <= value_2
```
Greater than
```
value_1 > value_2
```
Greater than or equal
```
value_1 >= value_2
```

#### Description {#description}
Compares the value `value_1` with the value `value_2`.

**Argument types:**
- `value_1` — `Array of fractional numbers | Array of integers | Array of strings | Boolean | Date | Datetime | Fractional number | Geopoint | Geopolygon | Integer | String | UUID`
- `value_2` — `Array of fractional numbers | Array of integers | Array of strings | Boolean | Date | Datetime | Fractional number | Geopoint | Geopolygon | Integer | String | UUID`


**Return type**: `Boolean`

{% note info %}

Due to implementation details of the `Fractional number` type in `ClickHouse` sources it is recommended to use the [COMPARE](COMPARE.md) function instead of comparison operators for this type.

{% endnote %}


#### Examples {#examples}

```
1 = 1 = TRUE
```

```
7 > 2 > 1 = 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`.
