Murray Brown
asked on
SQL Select Where equals array
Hi
I have a list of questions in a table with an ID field that numbers them
I have to take a list of numbers that could be up to 200 long and have to selectthose questions
Using eg Select * From Questions Where ID = 4 Or ID = 5 Or ID = 33............
would be far to cumbersome.
Is there a way to use my string "4,5,33......" in the SQL statement as an array
I have a list of questions in a table with an ID field that numbers them
I have to take a list of numbers that could be up to 200 long and have to selectthose questions
Using eg Select * From Questions Where ID = 4 Or ID = 5 Or ID = 33............
would be far to cumbersome.
Is there a way to use my string "4,5,33......" in the SQL statement as an array
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
keyu: your suggestion is exactly NOT WORKING ...
ASKER
Thank you all
@inputvar='4,5,13'
select * from tablename where id in @inputvar