row
1
1
1
2
2
now I want to insert this to another table like this
col1 col2 col3 col4 col5
1 1 1 2 2
and then replace 1 --->Y and 2-->N
What I have tried:
SELECT col1, col2, col3, col4,col5,col6,col7,col8,col9,col10,col11,col12,col13,col14,col15
FROM (
select * from Split('1:1:1:1:1:1:2:2:1:2:1:1:2:1:1:',':')
) Books
PIVOT (
FOR select * from Split('1:1:1:1:1:1:2:2:1:2:1:1:2:1:1:',':') IN (col1, col2, col3, col4,col5,col6,col7,col8,col9,col10,col11,col12,col13,col14,col15)
) Result;