Expand rows by column value in Presto -
i have data has id, number like:
id, number 1, 5 2, 3
and data be:
id, number 1, 0 1, 1 1, 2 1, 3 1, 4 1, 5 2, 0 2, 1 2, 2 2, 3
select t.id ,s.n mytable t cross join unnest(sequence(0,t.number)) s (n) ;
Comments
Post a Comment