-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
  • 12,898
  • 4
  • 21
  • 47

2 Answers2

1

You can split string like this:

SELECT 
    value  
FROM 
    STRING_SPLIT('a,b,c', ',');
sa-es-ir
  • 3,722
  • 2
  • 13
  • 31
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
  • 79,615
  • 7
  • 44
  • 66