I want to pass variable number parameters to sql query. As an example:
select column1
from Table
where column2 in ( '0080','0010')
group by column1
having count(distinct column2) >= 2
In the where clause, 2 arguments 0080 and 0010 are used. But this number of arguments can vary based on the input from user. As an example it could be like this:
select column1
from Table
where column2 in ( '0080','0010', '0020', '0050', '0060')
group by column1
having count(distinct column2) >= 5
So, this number of arguments is not fixed and it will be passed by the user from an .xml file.
How can we pass a variable number of arguments to the query? As the number of arguments is not fixed and it can be changed from time to time, can we use an array or something similar?