I am an amateur in postgresql and I am looking to split a comma delimited column into many columns. I managed to split my column into rows and insert new rows based on the number of separated strings with this code
INSERT INTO myTable (username, town)
SELECT
username,
regexp_split_to_table(town, E',')
FROM myTable;
Now what I want to achieve is, to remove the original column from database. Any advice would be appreciated.
This SQLFiddle shows what I done so far!