> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_array_intersect.md).

# JSON\_ARRAY\_INTERSECT

{% hint style="info" %}
`JSON_ARRAY_INTERSECT` is available from MariaDB 11.2.
{% endhint %}

## Syntax

```bnf
JSON_ARRAY_INTERSECT(arr1, arr2)
```

## Description

Finds intersection between two json arrays and returns an array of items found in both array.

## Examples

```sql
SET @json1= '[1,2,3]';
SET @json2= '[1,2,4]';

SELECT json_array_intersect(@json1, @json2); 
+--------------------------------------+
| json_array_intersect(@json1, @json2) |
+--------------------------------------+
| [1, 2]                               |
+--------------------------------------+
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
