Trying to create a variable for list of numbers

My original query looks like that:
select * from table where id in (1,2,15);

How can I create a variable instead of the list of numbers?
Something like:
select * from table where id in {{the_list}};

When I'm trying to put some numbers in the variable field, I get an error: "No results!" (Which is not true).

Hi @hadar
Without knowing which variable type you're using, then it's difficult to know.
https://www.metabase.com/docs/latest/questions/native-editor/sql-parameters
You are also missing the parenthesis around the variable. This should work with Number variable:
select * from table where id in ({{the_list}})

1 Like

Hey,
Variable type: text
thanks