Posts tagged unpivot
The UNPIVOT operator was introduced in Oracle Database 11g – see for example: http://technology.amis.nl/blog/2421/the-oracle-11g-unpivot-operator-turning-columns-into-rows. In Oracle, the UNPIVOT operation is the process of turning Columns to Rows. Put simply, by applying the UNPIVOT operator to a number of columns, every row is split into that same number of rows. Each of these rows has two new columns: one for the column that this row stems from â€“ one of the columns the data set was UNPIVOTed by â€“ and one with the value from the column. The original UNPIVOT-columns are no longer part of the newly created records.
We can use the UNPIVOT operator in ADF BC ViewObjects to derive multiple rows from individual records. Subsequently, these rows can be filtered by the property they represent. This sounds vague – I know. I will use this approach to achieve the following functionality: a page that displays a bar chart with values per department. Depending on the setting of a radio group, the chart will display the number of employees, the maximum salary, the average experience of the average salary per department. The chart is based on a single ViewObject that contains a single query More >