我有这张桌子:
+----------+--------+-----+--------+--------+
| personId | Name | Age | height | weight |
+----------+--------+-----+--------+--------+
| 1 | Aritra | 20 | 5.6 | 56 |
| 1 | Aritra | 30 | 5.6 | 76 |
+----------+--------+-----+--------+--------+
但要求输出是这样的:
+---------------+----------+--------------+----------+
| AttributeName | personId | Presentvalue | OldValue |
+---------------+----------+--------------+----------+
| Height | 1 | 5.6 | 5.6 |
| weight | 1 | 76 | 56 |
+---------------+----------+--------------+----------+
我试图使用枢轴来实现这一点,但遇到了问题。无论使用或不使用枢轴,我该如何做到这一点?
谢谢你。