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 wa
slight improvement on @LukeH, there is no need to repeat the "INSERT INTO": and @realPT's answer - no need to have the SELECT:
DECLARE @MyList TABLE (Value INT) INSERT INTO @MyList VALUES (1),(2),(3),(4) SELECT * FROM MyTable WHERE MyColumn IN (SELECT Value FROM @MyList)