IN-Clause Filter


#1

Hi,
Can I use multiple values as a efilter for the same column as SQL IN-Clause?

Example:
Select * from Table A where ID in (1,2,3)

The user will pass all 3 values as parameter.


#2

You can do this if you know in advance that your users will always enter three values.

SELECT *
FROM table_a
WHERE table_a.id in ( {{ first_param }}, {{ second_param }}, {{ third_param }} )

At the moment, Redash does not support dynamically adding and removing parameters. So if your user wants to include four values in the WHERE clause then they would need to modify the query to do so.