Insert new row with data computed from other rows
- by Tyler McHenry
Suppose I have a MySQL table called MyTable, that looks like this:
+----+------+-------+
| Id | Type | Value |
+----+------+-------+
| 0 | A | 1 |
| 0 | B | 1 |
| 1 | A | 2 |
| 1 | B | 3 |
| 2 | A | 5 |
| 2 | B | 8 |
+----+------+-------+
And, for each Id, I want to insert a new row with type C…