I have a Transact-SQL query that uses the IN operator. Something like this:
select * from myTable where myColumn in (1,2,3,4)
Is there a way to define a variable to hold the entire list "(1,2,3,4)"? How should I define it?
declare @myList {data type}
set @myList = (1,2,3,4)
select * from myTable where myColumn in @myList