Column names specified just before the FOR clause are referred to as measure_columns in the context of UNPIVOT operation. Column names specified after the FOR clause are referred to as unpivot_columns.
Similar to the PIVOT operator, columns with CLOB, BLOB, UDT, XML, or JSON data types are not allowed with the UNPIVOT operator.
The UNPIVOT column name and measure column names cannot be the same as the column names defined in the derived_table_name.
When multiple measure_columns are involved in UNPIVOT operation, the columns are compatible only if they belong to any of the following three groups:
- CHAR and VARCHAR
- BYTE and VARBYTE
- BYTEINT SMALLINT INTEGER BIGINT REAL DECIMAL NUMBER
Column names specified in the IN list cannot be specified in the assign list of the SELECT statement.