FYI there is no concept of arrays in SQL.But you can pass a comma seperated values to a query generated like this.declare @tbl as table(col1 int,col2 int,col3 int)insert into @tblselect 1,0,1 union allselect 1,0,1 select * from @tbldeclare @str as varchar(max)=''select @str=@str + ','+columns from(select columns,MAX(case when col=1 then 1 end)as status from(select * from @tbl)uunpivot(col for columns in(col1,col2,col3))vgroup by columns)t where status is not nullselect STUFF(@str,1,1,'')--select * from yourtable where column in (select STUFF(@str,1,1,''))
PBUH