-2

So, I have this table

col1
1,2,3
1,4,5

and I want it to be like this

col1
1
2
3
1
4
5
Lamanus
  • 10,897
  • 4
  • 14
  • 35

2 Answers2

1

You can split string like this:

SELECT 
    value  
FROM 
    STRING_SPLIT('a,b,c', ',');
Saeed Esmaeelinejad
  • 2,503
  • 2
  • 11
  • 26
1

It seems your delimited data is in a column. If so, you can use string_split() in concert with a CROSS APPLY

 Select col1=B.value
  From  YourTable A
  Cross Apply string_split(A.col1,',') B
John Cappelletti
  • 71,300
  • 6
  • 42
  • 62