我在转置表格时遇到了问题。我查看了不同的主题,但没有发现任何可以帮助我的事实。
我有下表:
product | code_characteristics | code_characteristic_value
-------------------------------------------------------------
product_1 | characteristic_1 | characteristic_1_value_x
product_1 | characteristic_2 | characteristic_1_value_y
product_2 | characteristic_3 | characteristic_1_value_z
product_3 | characteristic_4 | characteristic_1_value_w
... | ... | ...
我想得到这个:
product | characteristic_1 | characteristic_2 | characteristic_3 | ...
-------------------------------------------------------------------------------------------
product_1 | characteristic_1_value_x | characteristic_1_value_y | NULL
product_2 | NULL | NULL | characteristic_1_value_z
product_3 | NULL | NULL | NULL
... | ... | ... | ...
非常感谢您的帮助。