I have a field called client_no_all:
client_no_all
14521;555555;636582142;
I want to separate the values and assign them to client_no:
client_no
14521
555555
636582142
Should I use a cursor to loop or pivot?
I have a field called client_no_all:
client_no_all
14521;555555;636582142;
I want to separate the values and assign them to client_no:
client_no
14521
555555
636582142
Should I use a cursor to loop or pivot?
You can use following query.
The function string_to_array()
splits a string by a delimiter into an array.
With the function unnest()
you can expand an array to a set of rows.
SELECT unnest(string_to_array('1;2;3;4;5', ';')) AS val