Creating a pivot table with SQL Simon Hutchinson

​Alas, if I wanted to create the equivalent of a pivot table using Db2 for i there is not the equivalent of the PIVOT relational operator that there is in Microsoft SQL Server.A pivot table is taking a table’s data that is in rows and “turning on its side” to become data in columns. This is best demonstrated with an example. I have a file that lists sales by color, month, and year in separator rows. I want to convert that to be one row per column and year. If I am little creative I can do pivot data with Db2 for i.I have a SQL DDL Table, TESTTABLE that contains the data I want to pivot:Read more » Read More 

Verified by MonsterInsights