Skip to content
Advertisement

How to extract only rows matching condition ‘WHERE column1 IN column2’ (where column2 is an array)?

I am using postgresql.

Let’s suppose I have this table name my_table:

I want to select only the rows having the value of idm equal to one of the elements of the array in stores (of that line).

So I want to get something like this:

I have tryed with

but I get a syntax error.

Advertisement

Answer

You need to use the ANY() operator:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement