with tmp as ( select listagg(val,',') within group (order by l) vals from (select 'value'||level val, level l from dual connect by level <= 5) ) select regexp_substr(vals,'[^,]+',1,2) val2 from tmp