with recursive T as ( select 'a,b,c,d,e,f' as items), N as ( select 1 as n union select n + 1 from N, T where n <= length(items) - length(replace(items, ',', ''))) select distinct substring_index(substring_index(items, ',', n), ',', -1) group_name from N, T

 

(stackoverflow.com/questions/17942508/sql-split-values-to-multiple-rows)