我无法理解如何将不同的活动拆分和计数到单独的列中。这是开始表:
+------------+---------+
| CustomerID |Activity |
+------------+---------+
| 1 | Click |
| 1 | View |
| 1 | Inquiry |
| 2 | Click |
| 2 | View |
| 3 | Click |
| 3 | Click |
+------------+---------+
我希望能够将其转换为:
+------------+------+-------+---------+
| CustomerID | View | Click | Inquiry |
+------------+------+-------+---------+
| 1 | 1 | 1 | 1 |
| 2 | 1 | 1 | 0 |
| 3 | 0 | 2 | 0 |
+------------+------+-------+---------+