That's actually a lot harder than it sounds, because SQL deosn't have a concept of "lists" or even "arrays".
Depending on exactly what you want to do with the list this might help:
Using comma separated value parameter strings in SQL IN clauses[
^] - it deals with processing a commas separated string of vlaues into a temporary table for use in an SQL IN clause, which may go some way to helping you.