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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -