I have a table column which contains data with commas(no. of commas are fixed). I want to split the data and extract the data according to the comma. For example:
Select column_name From table->
->column_name
->adc,efg,ghi,ijk
I want to extract every text separated by the comma(till the last text). For example i need :
1)adc
2)efg
3)ghi
4)ijk
I found that it being done in PostGre, but cannot find in MS-SQL. I PostGre the following code was given:
select a[1], a[2], a[3], a[4], a[5], a[6]
from (
select regexp_split_to_array(column_name, ',')
from your_table
) as dt(a)