Open NeroCube opened 1 year ago
WITH keys AS ( SELECT DISTINCT l_key FROM your_table ) SELECT * FROM ( SELECT id, l_key, l_value FROM your_table ) PIVOT ( MAX(l_value) FOR l_key IN ( SELECT STRING_AGG(l_key, ',') FROM keys ) )