How to query PSQL using WHERE IN

Hi everyone!

I need to add WHERE IN condition to the query like this:

`WHERE IN ({{ workspace_vendors_query.data.id }})`

where workspace_vendors_query.data.id are the ids of the table "WorkspaceVendors"

How can I do that?

Currently, I’m receiving error like this:

invalid input syntax for integer: "{"18535","18534","18536"}"

Here is a screenshot of the property inspector showing workspace_vendors_query.data.id

image

And here is a screenshot of the erroring query

I have also tried doing...

WHERE IN ({{ workspace_vendors_query.data.id.join(", ") }})

But I get this error:
invalid input syntax for type integer: "9084, 9088, 9085"

Thank you for your help in advance!

John

2 Likes

Hi John, try to use

Where = ANY ({{ workspace_vendors_query.data.id}})
3 Likes

Hi Gabriel. Wow, this worked! Thank you so much for the suggestion! :hugs:

2 Likes