# JSON\_ARRAY\_INTERSECT

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

## Syntax

```sql
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" %}
