Reputation: 624
I've got a rather simple query, I just need to check that a row's primary key is in an array of integers.
This is my current query:
SELECT * FROM entries WHERE id in [573240252177580032, 706271127542038608, 772980293929402389]
However, this yields the following error: 'syntax error near or at "["'
How can I do this?
Upvotes: 1
Views: 47
Reputation: 23676
You can use the ANY
function for that:
SELECT *
FROM entries
WHERE id = ANY(ARRAY[573240252177580032, 706271127542038608, 772980293929402389])
Upvotes: 1