SQL Database Where IN Query

SQL Database Where IN Query

Comments

  • I'm using a Query in Decisions to retrieve this data, and I have a variable in it for a list of IDs: SELECT * FROM users WHERE id IN (@_ids) when I pass a string to this parameter, like \"1,5,10\

  • It seems like we have no way of handling a string list using the Add Query screen, as the string parameter will always append the opening and closing apostrophes needed for a string value. Ive attached a flow that uses a Raw SQL step to run the query. We first create a list of IDs, then merge the ID list into a single string formatted for the SQL query.

    This will return your expected results.

Sign In or Register to comment.