Dynamically pivoting a table in SAP HANA
In this thread
OP asks for an option to pivot a table in HANA.
The solution works, but I am interested in a dynamic solution so that it automatically adapts to the structure of the table and the columns names do not need to be created manually everytime a table needs to be pivoted...something like this for MySQL: http://buysql.com/mysql/14-how-to-automate-pivot-tables.html
SET @sql = NULL;
'MAX(IF(property_name = ''',
''', value, NULL)) AS ',
) INTO @sql
SET @sql = CONCAT('SELECT item_id, ', @sql, ' FROM properties GROUP BY item_id');
I have read the SCN forum and I do not want to do anything involving a calculation view or work with Data Services. Is there a way to do that?