1
で列の値で行を展開します。私はIDを持っているデータ、などの数持っているプレスト
id, number
1, 5
2, 3
をそして私は、データがなりたい:
id, number
1, 0
1, 1
1, 2
1, 3
1, 4
1, 5
2, 0
2, 1
2, 2
2, 3
で列の値で行を展開します。私はIDを持っているデータ、などの数持っているプレスト
id, number
1, 5
2, 3
をそして私は、データがなりたい:
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
from mytable t
cross join unnest(sequence(0,t.number)) s (n)
;