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

# LIKE



#### Syntax {#syntax}


```
string_1 [ NOT ] LIKE string_2
```

#### Description {#description}
Matches the string `string_1` to the template `string_2` and returns `TRUE` on match.
You can specify the value in `string_2` or use the `%` character to match a string of any length.

The `string_1 NOT LIKE` option returns the opposite value.

When comparing values, the function is case-sensitive. You can use `LIKE` along with [UPPER](UPPER.md) or [LOWER](LOWER.md) for case-insensitive comparison.

**Argument types:**
- `string_1` — `String`
- `string_2` — `String`


**Return type**: `Boolean`

#### Examples {#examples}

```
"raspberry" LIKE "%spb%" = TRUE
```

```
"raspberry" LIKE "%SPB%" = FALSE
```

```
"raspberry" NOT LIKE "%spb%" = FALSE
```

```
IF([Country] LIKE 'RU', 'Y', 'N')
```

```
IF([Phone] LIKE '+7%', 'RU', 'notRU')
```

```
UPPER("raspberry") LIKE "%SPB%" = TRUE
```

```
UPPER("West") LIKE "WEST" = TRUE
```


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

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