I have a JSON\_ARRAY of ids in the form of [1,3,...]. Each value represents an id to a value in another table.

```
Table: pets
id | value
 1 | cat
 2 | dog
 3 | hamster

Table: pet_owner
id | pets_array
 1 | [1, 3]
 2 | [2]
 3 | []

```

What I want to get when I query pet\_owners is the following result:

```
Table: pet_owner
id | pets_array
 1 | ["cat", "hamster"]
 2 | ["dog"]
 3 | []

```

How do I run a sub-select on each array element to get its value?