使用 MySQL 查询,如何获取示例 A 中的表:
Example A
+------+---------------+----------+
| id | value | class |
+------+---------------+----------+
| 1 | 33.00 | total |
| 1 | 12.00 | shipping |
| 2 | 45.00 | total |
| 2 | 15.00 | shipping |
+------+---------------+----------+
并创建一个类似于示例 B 的视图?
Example B
+------+---------------+---------------+
| id | value_total | value_shipping|
+------+---------------+---------------+
| 1 | 33.00 | 12.00 |
| 2 | 45.00 | 15.00 |
+------+---------------+---------------+