I am using Postgres for my Javascript project and I have an array of id's. Is there a way to return all the rows and their corresponding data using each id in the array.
I want to return all the rows that has the id that is in the array.
CodePudding user response:
One of various ways: pass an array literal to the = ANY
construct:
SELECT * FROM tbl WHERE id = ANY ('{46995, 54262, 73166}');
See: