We are migrating the SQL Server SSRS reports to Snowflake; I have a question about parameters in SQL version -
select *
from tbname
where xtype in (@xtype)
How to write this in the Snowflake version?
CodePudding user response:
In Snowflake you set a variable using the SET command and then reference it in SQL statements by prefixing it with $ e.g.
set (min, max)=(40, 70);
select $min;
select avg(salary) from emp where age between $min and $max;
Sample input values:
Dataset definition:
Dataset parameter (expression: =JOIN(Parameters!Param_XType.Value, "^")
):
Report test: