SQL: convert tokens in a string or elements of an array into rows of a table
- by slowpoison
Is there a simple way in SQL to convert a string or an array to rows of a table?
For example, let's stay the string is 'a,b,c,d,e,f,g'. I'd prefer an SQL statement that takes that string, splits it at commas and inserts the resulting strings into a table. In PostgreSQL I can use regexp_split_to_array() and split the string into an array. So, if you know a way to insert an array's elements as rows into a table, that would work too.