U kunt rijen opsommen met row_number()
en maak pivot
:
select *
from (
select d.*, row_number() over(partition by type order by id) rn from data d)
pivot (max(type) type, max(id) id for type in ('test1' t1, 'test2' t2))
U kunt rijen opsommen met row_number()
en maak pivot
:
select *
from (
select d.*, row_number() over(partition by type order by id) rn from data d)
pivot (max(type) type, max(id) id for type in ('test1' t1, 'test2' t2))