What I need:
I need SQL to loop through a column in my database (sortfield)
I need SQL to pass the values that are returned to a variable and add commas behind each value
I need SQL to place the values into a where clause
@sortfield will become '1', '2', '3'
my where clause will look like: where sortfield in ('1', '2', '3')
set @sortfield ='All'
set @sortfield='Number1'+, +'Number2'+, +'Number3'+, +'etc...
Select * from invoice where sortfield in (@sortfield)