T-SQL — convert comma-delimited column into multiple columns
问题 From the table below, how can I convert the Values column into multiple columns, populated with individual values that are currently separated by commas? Before the conversion: Name Values ---- ------ John val,val2,val3 Peter val5,val7,val9,val14 Lesli val8,val34,val36,val65,val71,val Amy val3,val5,val99 The result of the conversion should look like: Name Col1 Col2 Col3 Col4 Col5 Col6 ---- ---- ---- ---- ---- ---- ---- John val val2 val3 Peter val5 val7 val9 val14 Lesli val8 val34 val36 val65