jussi jussi -5 years ago 193
SQL Question

Search in integer array in Postgres

Is there any other way to search for a certain value in an

column in Postgres?

My currently installed Postgres version does not allow the following statement:

SELECT * FROM table WHERE values *= 10;

Array examples:


The statement should return every row where the array contains

Answer Source

For equality checks you can simply:

SELECT * FROM table WHERE 10 = ANY (values);

Read about ANY/SOME in the manual.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download