Oracle 11g行列转换之UNPIVOT

2014-11-24 18:48:00 · 作者: · 浏览: 4

现有表src_table如下:




目标表dest_table如下:




通过UNPIVOT实现如下:


SELECT *
FROM src_table
UNPIVOT (param_value FOR param_name IN (product_color AS 'product_color', product_type AS 'product_type', is_intelligent AS 'is_intelligent');