I am trying to generate a new row for each value in col2. As the value is in string format. They are either comma or space separated.
col1 col2 col3
1 ab cd ef Denver
2 gh Chicago
3 jk,lm,kn,ut,zx Dallas
Expected output
col1 col2 col3
1 ab Denver
1 cd Denver
1 ef Denver
2 gh Chicago
3 jk Dallas
3 lm Dallas
3 kn Dallas
3 ut Dallas
3 zx Dallas
How can we achieve it in Redshift SQL