With the follow result set:
side|timestamp_ms|sum |
----|------------|-----|
blue| 135| 1000|
red | 135| 1100|
blue| 1943| 2500|
red | 1943| 2900|
How can i calculate the difference of the sums between blue and red sides that share a timestamp_ms?
Ideally the new result set should be something like:
timestamp_ms|diff |
------------|-----|
135| -100|
1943| -400|