Comments
-
Thanks Scott for the review. I will amend the step 4 as yours! ? Regards, Sameer S
-
I got this one finally. Below is the sql code Step 1 SELECT GROUP_CONCAT( CONCAT( ' SELECT `Product Type` , ' ,QUOTE(COLUMN_NAME) , ' AS `Date`, ','`', COLUMN_NAME , '` AS `Revenue` ', 'FROM testing_unpivot' ) SEPARATOR ' UNION ALL ' ) as product_info FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'testing_unpivot' AND…
-
I am trying to use a Dynamic solution thru below query: SELECT GROUP_CONCAT( CONCAT( 'SELECT `Product Type`, ', QUOTE(COLUMN_NAME), ' AS `Date`, ', '`', COLUMN_NAME, '` AS `Revenue` ', 'FROM testing_unpivot' ) SEPARATOR ' UNION ALL ' ) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'testing_unpivot' AND COLUMN_NAME <>…