When I have a column with separated values, I can use the unnest() function:
unnest()
myTable id | elements ---+------------ 1 |ab,cd,efg,hi 2 |jk,lm,n
If the order of element is not important, you can
select id, elem, row_number() over (partition by id) as nr from ( select id, unnest(string_to_array(elements, ',')) AS elem from myTable ) a