I want to convert my parent child table to pivot,below is my query
CREATE TABLE parent_child
with recursive cte (id, name, parentid,level) as (
select id,
name,
parentid,
0 level
from CONFIG_CLASSIFICATION
where parentid is null
union all
select p.id,
p.name,
p.parentid,
cte.level + 1
from CONFIG_CLASSIFICATION p
inner join cte
on p.parentid = cte.id
)