Reputation: 77
Is there any way to split the following string |RPI;DHCP Letter;IFU;PIL;PCL| into |RPI|;|DHCP Letter|;|IFU|;|PIL|;|PCL|?
Any inputs would be helpful. Thank you.
Upvotes: 0
Views: 217
Reputation: 520908
If I read correctly, and the actual strings in your column do not deviate from the data you showed us, then I think we can simply do a blanket replacement of ;
with |;|
to get the output you want:
SELECT
REPLACE(col, ';', '|;|') AS new_col
FROM yourTable
Output:
|RPI|;|DHCP Letter|;|IFU|;|PIL|;|PCL|
Demo here:
Upvotes: 2