You are to aggregate headers from the Dev-stage 1 to Dev-stage 5 columns by their values and products.
Enter the following SQL query:
SELECT 'Product', 'Value', ARRAY('Dev-stage') AS 'Dev-stage' FROM ( SELECT * FROM T1 UNPIVOT ('Value' for 'Dev-stage' in (T1.'Dev-stage 1',T1.'Dev-stage 2',T1.'Dev-stage 3',T1.'Dev-stage 4',T1.'Dev-stage 5'))) GROUP BY 'Product', 'Value' |
Enter the following SQL query:
SELECT * FROM T1 PIVOT (FIRST ('Dev-stage') for 'Value') |