我在转换一张看起来像这样的桌子时遇到了问题
PropertyName | PropertyValue --------------------------------- color red color blue size big size small
Color | Size --------------------------------- red big red small blue big blue small
我怎样才能做到这一点?提前谢谢你的帮助。
你想要各种颜色和尺寸的排列吗?
SELECT color, size FROM ( select distinct PropertyValue AS color from YourTable where PropertyName = 'color' ) T1 CROSS JOIN ( select distinct PropertyValue AS size from YourTable where PropertyName = 'size' ) T2