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 |
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 |
You can split string like this:
SELECT
value
FROM
STRING_SPLIT('a,b,c', ',');
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