Let's assume we have a table

```
values
    (a, 2),
    (b, 1),
    (b, 2),
    (c, 1),
    (c, 3),
    (d, 4)

```

I want to get values from column1 that has pairs with specific values in column2.
E.g. values 1 and 2. As we can see in column2 there is 1 or 2 in rows (a, 2), (b, 1), (b, 2) and (c, 1) but we need to have both occurences so needed column1 value is b. How do I need to make query for doing this if values that I need occurence with given as array?

I have no problem for at least one occurence, but can't figure out how to do this.

```
SELECT column1 from table
where column2 = any(array[1, 2])

```

I don't understand why I'm stuck on this

UPD:
Because the table I'm working with has not only two cols, but few others that gives row uniqueness. It is possible that this pair of values will be duplicated.
Like this:

```
values
    (a, 2, unique_value),
    (b, 1, unique_value),
    (b, 2, unique_value),
    (c, 1, unique_value),
    (c, 3, unique_value),
    (d, 4, unique_value),
    (c, 1, unique_value)

```