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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -