sql - Split comma separated values to columns in Oracle -
i have values being returned 255 comma separated values. there easy way split columns without having 255 substr?
row | val ----------- 1 | 1.25, 3.87, 2, ... 2 | 5, 4, 3.3, ....
to
row | val | val | val ... --------------------- 1 |1.25 |3.87 | 2 ... 2 | 5 | 4 | 3.3 ...
you can use regexp_substr()
:
select regexp_substr(val, '[^,]+', 1, 1) val1, regexp_substr(val, '[^,]+', 1, 2) val2, regexp_substr(val, '[^,]+', 1, 3) val3, . . .
i suggest generate column of 255 numbers in excel (or spreadsheet), , use spreadsheet generate sql code.
Comments
Post a Comment