我有一个按列格式设计的表格,如下所示:
+------+---------+-------------+------------+
| S_ID | S_NAME | MARK_NUMBER | MARK_VALUE |
+------+---------+-------------+------------+
| 1 | TEST | MARK1 | 50 |
| 1 | TEST | MARK2 | 60 |
| 1 | TEST | MARK3 | 70 |
| 2 | TEST_! | MARK1 | 40 |
| 2 | TEST_! | MARK2 | 50 |
| 2 | TEST_! | MARK3 | 40 |
+------+---------+-------------+------------+
MARK_NUMBER
列将有“N”个标记。我无法定义它/将其配置为静态的(如其他 SO 答案中所述)。我需要将此表转换为按列格式,如下所示:
S_ID S_Name MARK1 MARK2 MARK3
1 TEST 50 60 70
2 TEST_! 40 50 40