---
schema_version: "1"
id: 4405f9b46e92c1a9fcc9da33be9c3c0a007b43a532d2d1f5310c46053940a599
title: LIKE / ILIKE
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/string-matching/like.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/like.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 38ef5efec5c5ff2946eaa10daacf654e4a01ea828937e9447c1cb1d38cb3d318
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `LIKE` / `ILIKE`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Pattern matching operator that checks whether a string matches a specified pattern using wildcards. `LIKE` is case-sensitive, but `ILIKE` is case-insensitive.

## Syntax

```sql
<string> LIKE <pattern> [ESCAPE <escape_character>]
<string> NOT LIKE <pattern> [ESCAPE <escape_character>]
<string> ILIKE <pattern> [ESCAPE <escape_character>]
<string> NOT ILIKE <pattern> [ESCAPE <escape_character>]
```

## Arguments

### Required

- `<string>`: The string to match against.
- `<pattern>`: The pattern to match, which can contain wildcard characters.

### Optional

- `<escape_character>`: The character used to escape wildcard characters. Defaults to backslash (`\`).

## Returns

Returns a boolean value indicating whether the string matches the pattern.

## Considerations

- **Wildcards**: `_` matches any single character. `%` matches any sequence of zero or more characters.
- **Full string match**: `LIKE` always covers the entire string. Use `%` at the start and end to match anywhere within a string.
- **Escaping**: To match a literal `_` or `%`, precede it with the escape character.
- **No escape**: Use `ESCAPE ''` to disable escape character handling.

## Operator Equivalents

| Operator | Equivalent  |
| :------- | :---------- |
| `~~`     | `LIKE`      |
| `~~*`    | `ILIKE`     |
| `!~~`    | `NOT LIKE`  |
| `!~~*`   | `NOT ILIKE` |

## Examples

### Basic Pattern Matching

Match strings using wildcards.

```sql
SELECT 'abc' LIKE 'abc' AS result;
```

Returns `true`.

```sql
SELECT 'abc' LIKE 'a%' AS result;
```

Returns `true` because `%` matches any sequence of characters.

```sql
SELECT 'abc' LIKE '_b_' AS result;
```

Returns `true` because `_` matches any single character.

### Case-Insensitive Matching

Use `ILIKE` for case-insensitive matching.

```sql
SELECT 'Hello World' ILIKE 'hello%' AS result;
```

Returns `true`.

### Escaping Wildcards

Match literal wildcard characters.

```sql
SELECT 'price_100' LIKE 'price\_100' AS result;
```

Returns `true` because `\_` matches a literal underscore.

### Custom Escape Character

Use a custom escape character.

```sql
SELECT 'price_100' LIKE 'price!_100' ESCAPE '!' AS result;
```

Returns `true` using `!` as the escape character.

### Matching Anywhere in String

Find a pattern anywhere within a string.

```sql
SELECT name FROM products
WHERE name LIKE '%widget%';
```

Returns all products with "widget" anywhere in the name.

## Related Documentation

- [Regular Expression Match Operators](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/regex-match.md)
- [String Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/string.md)
